Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to modify Content-Type in postman

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

like image 519
Gaurav Joshi Avatar asked Feb 14 '21 08:02

Gaurav Joshi


People also ask

Where is Content-Type selected in Postman?

To do this, open Postman and create a new request by selecting New->Request from the top left: Under Headers, select Key = Content-Type: For Value, select application/json: THANKS FOR READING.

How do you specify Content-Type in a POST request?

In a POST request, resulting from an HTML form submission, the Content-Type of the request is specified by the enctype attribute on the <form> element.

How do I remove Content-Type from Postman?

Go to the body tab, select 'raw' from the sub menu. To the right of 'binary' in the sub menu, a picklist will be available. Select 'Text' (not 'Text[text/plain]') from this list. This will remove the Content-Type header.

How to set the content type of Postman Postman?

You need to set the content-type in postman as JSON (application/json). Go to the body inside your POST request, there you will find the raw option. Right next to it, there will be a drop down, select JSON (application.json).

How do I set a header in Postman?

If you use raw mode for your body data, Postman will set a header based on the type you select (e.g. text, json). If you manually select a Content-Type header, that value will take precedence over what Postman sets.

What is the default header type for Postman binary body types?

Postman does not set any header type for the binary body type. By default, Postman will select None —leave it selected if you do not need to send a body with your request.

How do I create an application/json request in Postman?

To do this, open Postman and create a new request by selecting New->Request from the top left: Under Headers, select Key = Content-Type: For Value, select application/json:


2 Answers

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

like image 130
emery Avatar answered Oct 24 '22 08:10

emery


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

like image 10
FluxedScript Avatar answered Oct 24 '22 08:10

FluxedScript