How to send the request to backend which is expecting in the type application/x-www-form-urlencoded

postmanscreenshot.pngHello APIGEE Folks, I struck in the requirement where the back-end seems to be some sort of java servlet , and i think its is expecting the request in the format application/x-www-form-urlencoded, as i could get the response in the postman with this content type in the request header and request being posted through x-www-form-urlencoded option in postman with Key value pair. i have attached the post man screen shot for the same.

So Now my task is to simulate the request exactly same as postman in the APIGEE so that i could receive the response. tried couple of option given in the forums like https://community.apigee.com/questions/27824/sending-payload-as-x-www-form-urlencoded-type-usin.html , but dint work.could you please help.

0 3 1,036
3 REPLIES 3

Hi Folks just to update you guys,

i could achieve the above by using the AM policy with below values

<Add> <FormParams> <FormParam name="Key">{value}</FormParam> </FormParams> </Add>

Also please let me know if any other best solution.

Also Need your help to address this issue which i am facing after receiving the response

https://community.apigee.com/questions/50051/how-to-extract-the-xml-message-from-the-html-respo.html

Not applicable

Call a javascript policy and add the content type in request header. Something like below:

context.setVariable("request.header.Content-Type","x-www-form-urlencoded");

This should be done before the request sent to the target server.

Hope this helps.

Thanks suresh for the response, will try that option as well. Also could you please help for response which i am receiving , posted in https://community.apigee.com/questions/50051/how-to-extract-the-xml-message-from-the-html-respo.html