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

**URL:** <https://community.postman.com/t/form-data-works-for-post-request-but-not-raw/393>\
**Category:** Help Hub\
**Tags:** authentication, raw, form-data, api\
**Created:** [December 4, 2017, 12:02am UTC](https://community.postman.com/t/form-data-works-for-post-request-but-not-raw/393 "2017-12-04T00:02:48Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![baneyoftheyear](https://avatars.discourse-cdn.com/v4/letter/b/f6c823/32.png) [@baneyoftheyear](https://community.postman.com/u/baneyoftheyear)\
**Post date:** [December 4, 2017, 12:02am UTC](https://community.postman.com/t/form-data-works-for-post-request-but-not-raw/393/1 "2017-12-04T00:02:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dhoyt](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/dhoyt/32/238_2.png) [@dhoyt](https://community.postman.com/u/dhoyt)\
**Post date:** [January 10, 2018, 5:02pm UTC](https://community.postman.com/t/form-data-works-for-post-request-but-not-raw/393/2 "2018-01-10T17:02:39Z")

</div>

What JSON structure does your endpoint expect and what does your “raw” data look like in the body section ?

---

<div class="post-metadata">

**Author:** ![peterconchar](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/peterconchar/32/260_2.png) [@peterconchar](https://community.postman.com/u/peterconchar)\
**Post date:** [January 18, 2018, 10:17pm UTC](https://community.postman.com/t/form-data-works-for-post-request-but-not-raw/393/3 "2018-01-18T22:17:49Z")

</div>

Hello, I have the same problem.

 ![form-data](https://us1.discourse-cdn.com/getpostman/original/3X/7/d/7d6c82b1ad977c7691afd83c0a0008d30048290b.png)

---

<div class="post-metadata">

**Author:** ![peterconchar](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/peterconchar/32/260_2.png) [@peterconchar](https://community.postman.com/u/peterconchar)\
**Post date:** [January 18, 2018, 10:18pm UTC](https://community.postman.com/t/form-data-works-for-post-request-but-not-raw/393/4 "2018-01-18T22:18:22Z")

</div>

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

 ![raw](https://us1.discourse-cdn.com/getpostman/original/3X/c/2/c21c6df447c1112dd67d1f397285b3cb4e8e11a1.png)

---

<div class="post-metadata">

**Author:** ![mhurtado1016](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@mhurtado1016](https://community.postman.com/u/mhurtado1016)\
**Post date:** [October 29, 2020, 10:07pm UTC](https://community.postman.com/t/form-data-works-for-post-request-but-not-raw/393/5 "2020-10-29T22:07:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![allenheltondev](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/allenheltondev/32/31738_2.png) [@allenheltondev](https://community.postman.com/u/allenheltondev)\
**Post date:** [October 30, 2020, 11:48am UTC](https://community.postman.com/t/form-data-works-for-post-request-but-not-raw/393/6 "2020-10-30T11:48:44Z")

</div>

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.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/7/8/78aee4b8ddaf62f4b4f89697d4054b3df4aa2eac.png)

---

<div class="post-metadata">

**Author:** ![mhurtado1016](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@mhurtado1016](https://community.postman.com/u/mhurtado1016)\
**Post date:** [October 30, 2020, 9:25pm UTC](https://community.postman.com/t/form-data-works-for-post-request-but-not-raw/393/7 "2020-10-30T21:25:47Z")

</div>

Thanks @allenheltondev,

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

this is ok:

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/6/2/6256c5a151aaa9a6c0597d29b13d3d53e2fd2d65.png)  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/9/a/9a3dedf9766e21c447afaeb6715076f80e495625.png)

but, json request:  
 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/f/f/ff6f466bed6a14cdcd108f2b3ffacd3af700f931.png)

I get this error:  
“msg”: “No se encontró el envio de la variable ‘informacion’”  
but, “informacion” property is.

---

<div class="post-metadata">

**Author:** ![allenheltondev](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/allenheltondev/32/31738_2.png) [@allenheltondev](https://community.postman.com/u/allenheltondev)\
**Post date:** [November 2, 2020, 12:31pm UTC](https://community.postman.com/t/form-data-works-for-post-request-but-not-raw/393/8 "2020-11-02T12:31:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![martin3](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/martin3/32/6230_2.png) [@martin3](https://community.postman.com/u/martin3)\
**Post date:** [November 6, 2020, 11:26am UTC](https://community.postman.com/t/form-data-works-for-post-request-but-not-raw/393/9 "2020-11-06T11:26:49Z")

</div>

I have the same issue I think

I’m sending this

 ![Screenshot_1](https://us1.discourse-cdn.com/getpostman/original/3X/e/9/e9a3a2b9c4fe552058c182b7647b6dda8c9d641d.png)

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

---

<div class="post-metadata">

**Author:** ![allenheltondev](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/allenheltondev/32/31738_2.png) [@allenheltondev](https://community.postman.com/u/allenheltondev)\
**Post date:** [November 6, 2020, 12:12pm UTC](https://community.postman.com/t/form-data-works-for-post-request-but-not-raw/393/10 "2020-11-06T12:12:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pangestu-k](https://avatars.discourse-cdn.com/v4/letter/p/c77e96/32.png) [@pangestu-k](https://community.postman.com/u/pangestu-k)\
**Post date:** [September 7, 2022, 3:35am UTC](https://community.postman.com/t/form-data-works-for-post-request-but-not-raw/393/11 "2022-09-07T03:35:58Z")

</div>

![image](https://us1.discourse-cdn.com/getpostman/original/2X/3/32b050e24948826236e09beb3b597091af01a6b6.png)

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

---

<div class="post-metadata">

**Author:** ![emdadul.sadik](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@emdadul.sadik](https://community.postman.com/u/emdadul.sadik)\
**Post date:** [November 7, 2023, 11:58pm UTC](https://community.postman.com/t/form-data-works-for-post-request-but-not-raw/393/12 "2023-11-07T23:58:25Z")

</div>

I have solved it here:

> <https://stackoverflow.com/questions/77442095/postman-submitting-raw-post-data-for-php>
