You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My function consumes a POST request with Content-Type as x-www-form-urlencoded: { "authLevel": "anonymous", "type": "httpTrigger", "direction": "in", "name": "req", "methods": ["post"] },
In my code I read the posted data using req.rawBody. Posting directly to the function works fine. However, I have this endpoint behind an API Management facade, and when called through that I get an error because req.rawBody is undefined.
Following investigation, when forwarding the request, API Management adds a load of extra HTTP headers. I tried after adding them one at a time to a request in Postman and the one that triggers the issue is X-AppService-Proto: https.
Expected behavior
req.rawBody should be populated whether the request is direct or via API Management.
Actual behavior
req.rawBody is undefined where the request is forwarded via API Management.
Known workarounds
Make requests directly.
Related information
I'm using Javascript, and this function only uses HTTP bindings (trigger and out).
The text was updated successfully, but these errors were encountered:
Apologies for the late response. We're trying to investigate this, can you log the context object (JSON.stringify(context)) and provide us with what it looks like when called directly vs when called through APIM , please ?
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.
Investigative information
Please provide the following:
Repro steps
My function consumes a POST request with Content-Type as x-www-form-urlencoded:
{ "authLevel": "anonymous", "type": "httpTrigger", "direction": "in", "name": "req", "methods": ["post"] },
In my code I read the posted data using req.rawBody. Posting directly to the function works fine. However, I have this endpoint behind an API Management facade, and when called through that I get an error because req.rawBody is undefined.
Following investigation, when forwarding the request, API Management adds a load of extra HTTP headers. I tried after adding them one at a time to a request in Postman and the one that triggers the issue is X-AppService-Proto: https.
Expected behavior
req.rawBody should be populated whether the request is direct or via API Management.
Actual behavior
req.rawBody is undefined where the request is forwarded via API Management.
Known workarounds
Make requests directly.
Related information
I'm using Javascript, and this function only uses HTTP bindings (trigger and out).
The text was updated successfully, but these errors were encountered: