Search code examples
posthttp-postpostmanrestful-architecturerestful-authentication

Create POST Request with Postman


This curl is working fine and returns the token as expected:

curl -X POST -H "X-Requested-With: XMLHttpRequest" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{ "username": "pere.peris@gmail.com","password": "password" }' "http://75.90.255.68:1133/canPeris/auth"

But when I do the same call using Postman app I get a 401 Unauthorized as a return value

enter image description here


Solution

  • You should add the missing JSON inside the Body . click Raw combo box and add

    { "username": "pere.peris@gmail.com","password": "password" }