'form-data' works for POST request, but not 'raw'

I am making an api call that takes three parameters in the request: client_id, authorization_id, and query_params, a list of optional configurations. Essentially what the API call does is give you back vehicle information when you give them a VIN number. When I put these three parameters into form-data, it works and I get back all the correct vehicle data I was expecting to see. When I use the raw tab, with an identical JSON object, I get back ā€˜Authentication Failedā€™. This is driving me nuts as I believe solving this would also be the solution to the reason it wonā€™t work in my AngularJS application where I get back the same error response. I checked the network tab for the response in my application, and double checked the headers in Postman, and they both have Content-Type: ā€˜application/jsonā€™, I am at a loss as to why one would work, and not the other.

1 Like

What JSON structure does your endpoint expect and what does your ā€œrawā€ data look like in the body section ?

Hello, I have the same problem.

I share the screenshots with all the forms I have tried; But in form-data if it works for me.

Hi, i have the same problem, please @peterconchar, could you solve it?

Hey @mhurtado1016, welcome to the community!

If your request is formData but youā€™re putting it in the raw window, make sure you include the Content-Type header so your API knows how the data is formatted.

1 Like

Thanks @allenheltondev,

Iā€™m trying to convert a post request with form-data to a raw body request with json.

this is ok:


but, json request:
image

I get this error:
ā€œmsgā€: ā€œNo se encontrĆ³ el envio de la variable ā€˜informacionā€™ā€
but, ā€œinformacionā€ property is.

Do you know if your API supports that content type? The error message is making me think it doesnā€™t.

I have the same issue I think

Iā€™m sending this

IĀ“m getting this result
{ā€œ{\r\n___"trackingID":"0001-000500000057-S",\r\n____"bultos":1,\r\n__"linea"__:_1\r\n}ā€:ā€œā€}

Itā€™s started suddenly

So the response of your API is the same as the request you sent in?

if you get thatā€™s problem you can use this way, just add this (see the image) on the header section, boom itā€™s absolutely works

I have solved it here: