Post method request body is not coming to ApigeeX

I have created a pass through proxy. 

Method: POST and sent with request body but apigeeX is not receiving the body in request and failing with 403 error. When I remove  "user_agent": "edg" request body is coming to ApigeeX.  I have to send request to ApigeeX with "user_agent" in payload. Can anyone help me on this.

1 1 117
1 REPLY 1

I don't think you have correctly reported what you are seeing and doing.  Or maybe you are not understanding what you are seeing. 

It's my understanding that the "user_agent" : "edg" is something that would come from the Microsoft Edge browser. so I am guessing that 

  • you are using the Edge browser to invoke an API hosted on Apigee. When you do that, you see a 403 error. 
  • your phrase "When I remove  "user_agent": "edg" request body is coming to ApigeeX" means , you are trying a similar request from a different client, like ... Postman, or curl, or something else. 

Based on this I think you are seeing a CORS error. The browser is rejecting the outbound POST request: refusing to send it. Your phrase "apigeeX is not receiving the body in request", maybe indicates that the browser has sent the preflight request, which is an OPTIONS call, and that request has no body.  But the proxy is not correctly handling that preflight request, is not responding with the appropriate Access-Control- headers, and when the browser (edge) receives that response, it then refuses to send out the POST .  So you see one request being handled by your proxy: the CORS preflight, and no POST request. 

If you don't understand any of this, I can suggest that you read up on CORS: how it works, why it exists. Also,  I recorded a screencast / tutorial about the CORS policy in Apigee, some time ago. View it here.  It gives a brief overview of how CORS works, but doesn't really explain why it was created.