1

I have been working on a third party API integration for a system I am working on.

There I am invoking a login call to the third party via Postman for which I get a 502 response. However, if I invoke the same using the CURL request generated by Postman, it gives me the required response.

Why two different types of requests behave in different ways?

In addition to this, I have the implementation done using Spring for the same. That one too returns the 502 response.

What could be the reason for this? Any help to get over this?

EDIT

I checked with RestClient too. It also returns 502 and the CURL request generated by it returns successfully.

vigamage
  • 1,975
  • 7
  • 48
  • 74
  • 1
    Check the differences in headers in both requests - from resttemplate and from postman. Looks like you are missing an header. – prady00 Jan 07 '19 at 09:19
  • [502 HTTP Status Code](https://stackoverflow.com/questions/5011632/502-http-status-code) . – dbl Jan 07 '19 at 09:20
  • all are same. However, the curl request generated from Postman works fine while postman returns 502 – vigamage Jan 07 '19 at 09:20
  • Do you get any exceptions when getting 502 by using Postman? if yes, please post. – Ramesh Subramanian Jan 07 '19 at 09:59
  • Found what I had been doing wrong actually. The server side needed the request body in x-www-form-url-encoded format while i was sending it as a plain text. However, no header is needed to let the server know that the data is in this particular format. – vigamage Jan 09 '19 at 09:27

0 Answers0