How to modify Content-Type in postman
Asked Answered
M

4

33

I'm trying to test my logic app API in postman but I'm having an issue with header postman automatically adding

Content-Type = multipart/form-data;

when I hover on the content-type tab seeing this "use the request body tab to control the value or remove the header"

Can anyone help me with how I can set Content-Type = application/json

enter image description here

Manzoni answered 14/2, 2021 at 8:57 Comment(3)
You should just be able to untick that and manually add an header you want. – Eight
Hi Danny I tried to untick but postman automatically added when you click on send button below mentioned solution worked for me. – Manzoni
If you manually added a new Content-Type: application/json header, it would have used that. Going the route mentioned, would add that header too as it's matching the Content-Type to the body that you're using, for example JSON but you can add any Headers you like by manually typing them into a new field. 😁 – Eight
S
18

Go to Body -> select raw -> Select JSON from the dropdown. It should look like the image below then set it to application/json

enter image description here

Stratagem answered 14/2, 2021 at 9:2 Comment(3)
I am missing this option of "JSON" in my POSTMAN – Wendelin
@YuvalLevy I still see it on both mac and windows. Try install the latest version or use emery's answer – Stratagem
Make sure you click the "raw" option, then "JSON" will pop up – Eldenelder
D
46

Postman won't allow you to edit the headers that it auto-generates based on your drop-down selections, and Content-Type is one of these.

However it will allow you to deselect the auto-generated header and add a custom Content-Type header with any value you want. As far as the actual request is concerned, that's equivalent.

custom content type header in postman

Data answered 18/6, 2021 at 18:51 Comment(3)
This should be the answer. I spent an hour trying to figure out what was wrong with my code. Postman wouldn't send the data to my API. Thanks. – Borne
@RutwickGangurde As time goes by Postman refuses to listen to what we want (like calling other requests from a test) and instead they decide to take a page out of Google's and Microsoft's playbooks and frustrate the crap out of everybody. – Biparous
@MikeCheel I have to agree with you on that. Many simple tasks are absolutely complicated or hidden so well that you cannot help but pull your hair out. – Borne
S
18

Go to Body -> select raw -> Select JSON from the dropdown. It should look like the image below then set it to application/json

enter image description here

Stratagem answered 14/2, 2021 at 9:2 Comment(3)
I am missing this option of "JSON" in my POSTMAN – Wendelin
@YuvalLevy I still see it on both mac and windows. Try install the latest version or use emery's answer – Stratagem
Make sure you click the "raw" option, then "JSON" will pop up – Eldenelder
B
1

Also you can go to Headers --->Presets-> Manage Presets enter image description here and click on add to give your custom Header preset

custom header details

now you can see your custom Header , select to use it enter image description here

Brynn answered 23/2, 2023 at 12:16 Comment(0)
P
-1

Taking the example of the auto-generated Cookie header, if you would like to get rid of it, just click on the blue Cookies text (top-right), and unselect all the unwanted cookies, and the cookie header will be modified accordinaly

enter image description here

Pottle answered 25/8, 2022 at 9:30 Comment(0)

© 2022 - 2024 β€” McMap. All rights reserved.