Reputation: 782
Can someone explain to me why this request is not working and showing me "invalid character" at colon!
Upvotes: 4
Views: 27648
Reputation: 19929
You have copied the json body from browser or other non standard text editor so the asci character for "," is not the actually one. it got resolved into something else . Just delete it and replace that comma and double quotes with correct correctors.
{
"message":"hi",
"tg_chat_id": "5"
}
Also in postman you can press ctrl+b to format and remove space , (that's not the reason for error though)
Upvotes: 5
Reputation: 5640
The POST URL you are using might be wrongly written. 400 typically means you passed something invalid to the API. This error message tends to be pretty helpful when it comes to figuring out what is wrong.
Just try keeping a single Key Value pair in Headers
like Content-Type application/json
.
Body->raw->JSON selection looks okay.
JSON should be like this:
{
"message":"hi",
"tg_chat_id":"5"
}
Upvotes: -1