gkeenley
gkeenley

Reputation: 7408

API endpoint works with JSON, not with raw text

I'm hitting an API endpoint with Postman. I put the settings for the body input to raw+JSON and passed the following body:

{
  "a": 1,
  "b": 2,
  "c": 3
}

This worked fine. However, when I set it to raw+Text and passed

a=1&b=2&c=3 it returned the following error:

"Invalid payload Error: There was an error deserializing the object of type InTowConnect._default35+RequestRequest. Encountered unexpected character 'a'."

Does anyone know how I can approach debugging this?

Upvotes: 0

Views: 206

Answers (1)

DBoe
DBoe

Reputation: 28

JSON is it's own standard and not a text string. The parser you're sending to most likely isn't accepting a protocol other than the expected JSON. JSON != text.

Upvotes: 1

Related Questions