cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

POST Requests Being Converted to GET in SAP BTP Cloud Foundry Environment

KeerthiG
Explorer
0 Kudos
704

Hi all,

I hope this message finds you well.

I am currently facing an issue with my application backend, which I have developed using the Python Django framework. The application consists of several APIs that have been thoroughly tested and work perfectly fine when run locally. The APIs correctly handle different request types (e.g., POST, GET, PUT, etc.) without any issues.

However, after deploying the application to the Cloud Foundry environment on SAP BTP, I’ve encountered a strange issue where all incoming requests are being interpreted as GET requests, regardless of the original request method. This problem surfaced suddenly, despite the application working as expected after the initial deployment.

What I’ve Tried:

  • I’ve thoroughly reviewed my application code, including all route configurations, middleware, and view logic, to ensure there are no issues that could cause this behavior.
  • I’ve also checked for any anomalies in the request and response logs while running the application locally versus in Cloud Foundry.
  • Additionally, I verified that there are no URL malformations or issues with the way requests are being sent to the backend.

Despite these efforts, the problem persists only when the application is deployed on Cloud Foundry. I’m reaching out to see if anyone in the community has experienced a similar issue or can provide insights into what might be causing Cloud Foundry to interpret all requests as GET requests.

Any guidance or suggestions for further troubleshooting steps would be greatly appreciated.

Thank you in advance for your support!

Best regards,
Keerthi

Accepted Solutions (0)

Answers (2)

Answers (2)

evanireland
Product and Topic Expert
Product and Topic Expert

Finding: if the client accidentally uses http://... instead of https://..., this issue will occur (i.e. POST gets changed to GET and other verbs DELETE/PATCH/PUT don't get changed).

Solution: Client should use https://... URL.

jiking
Discoverer
0 Kudos
Thank you, this was it in my case! I did not specify any protocol, and after adding https://, the request got through as POST
KeerthiG
Explorer
0 Kudos

Thank you for your response. To clarify my setup:

  1. Client: The client in my setup is a user interacting with the application via a web interface. The requests are generated by the user's actions on the front-end, which communicates with the backend APIs developed using Python Django.

  2. SAP Approuter: I have not used an SAP Approuter in this setup. The application is directly deployed on the Cloud Foundry environment in SAP BTP, and all routing and request handling are managed by Django and its associated configurations.

  3. XSUAA Security: The API is not secured using XSUAA (XS Advanced User Account and Authentication). Currently, the APIs are using standard Django authentication mechanisms (or another relevant mechanism, if applicable), but not the XSUAA service provided by SAP BTP.

Given that my setup does not involve the use of an SAP Approuter or XSUAA, the issue I'm encountering with all requests being interpreted as GET requests seems to be related to the Cloud Foundry environment itself or how Django interacts with it. Any insights into this specific issue within the context of my setup would be highly appreciated.

evanireland
Product and Topic Expert
Product and Topic Expert
0 Kudos
I've just observed a similar situation today. Unfortunately I have no idea of the cause.
evanireland
Product and Topic Expert
Product and Topic Expert
0 Kudos
Did you get a resolution through some other channel?
evanireland
Product and Topic Expert
Product and Topic Expert
0 Kudos
In the case I saw this, I was testing with sap_java_buildpack with SAPmachine 17 and Tomcat.