Table of Content
The Content-Type header is an entity-header in HTTP used to indicate the media type of the resource. It informs the client about the type of data the server will send back in response to the request made by the client. When used in request headers, it tells the server what type of data is being sent in the body of the request.
In the Content-Type HTTP header, directives include specification of
subType along with optional parameters like
boundary, etc. The
mediaType indicates the category of file type while
subType specifies the exact file type. For instance, in Content-Type: text/html,
text is the
html is the
Content-Type: text/html; charset=UTF-8
Content-Type: multipart/form-data; boundary=something
How to modify Content-Type header
ModHeader is a Chrome extension that can be used to modify HTTP request headers, including the Content-Type. To use ModHeader to modify the Content-Type header:
Install the ModHeader extension from the Chrome Web Store.
Click on the ModHeader icon to bring up the ModHeader pop-up window.
Click on "+ Add" near the Request Headers section.
In the empty boxes that appear, input 'Content-Type' in the 'Name' field and the desired media type in the 'Value' field.
By doing this, all your subsequent client requests will have its Content-Type header set to whatever you specified in ModHeader. This is particularly useful for developers, as it allows them to emulate different data types being sent to the server and observe the server's response.