ice7101
ice7101

Reputation: 101

Postman to test web API to get a oauth token. But always get 400 BAD REQUEST response

I tried to POST a request to a web API. The website help says if I POST a JSON like this, it will response with a token:

{
  "client_id": "0xDMgCIF9bW3bRBKlUicpivvOoLGExCJqbOHqPYI",
  "client_secret": "BQKCoBO3iNXo52cMmiKPmuyYW0mE1PpPJOHXxQFgcJuWzg92PC",
  "grant_type": "client_credentials"
}

But after I use Postman to POST the request, I put the above string in the body section, it always return 400 BAD REQUEST response. I have never used POSTMAN before. Can someone help to check if the string content is correct or not?

Postman result

Upvotes: 0

Views: 422

Answers (1)

PDHide
PDHide

Reputation: 19979

you have to choose body type as json not formdata:

enter image description here

choose body>raw>json and replace the content with your json

Upvotes: 0

Related Questions