DIV
DIV

Reputation: 263

Works in curl (and Rested API Client) but not in Postman?

I am able to login my local (and remote server) with the following curl (which I generated using Postman)... and I can login successfully using another API Client (Rested) with the same params/headers/body that I am trying to use in Postman. I've turned off "SSL cert verification" and "Send Postman Token header" in settings (per other Stack Overflow answers).. but still getting an unauthorized response from server when using Postman (but not when using curl or Rested)

curl:

curl -X POST \ http://localhost:8080/api/user/login \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -d '{ "email": "[email protected]", "password": "examplemail**" }'

And here is my log..

enter image description here

Upvotes: 0

Views: 1384

Answers (1)

DIV
DIV

Reputation: 263

I just solved my own Q.. and posting this answer because I've seen other questions re: curl working but postman not on SO and Postman communities. My solution was to check the Content-Length header and Connection headers. They were auto populating anyway, so after 'accepting' them as headers, the Postman request worked. Here is a screenshot of the headers that worked.

enter image description here

Upvotes: 2

Related Questions