'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: