# I am unable to overwrite the Content-Type

**URL:** <https://community.postman.com/t/i-am-unable-to-overwrite-the-content-type/38147>\
**Category:** Help Hub\
**Created:** [August 12, 2022, 8:43am UTC](https://community.postman.com/t/i-am-unable-to-overwrite-the-content-type/38147 "2022-08-12T08:43:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![diontheunissenapi](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@diontheunissenapi](https://community.postman.com/u/diontheunissenapi)\
**Post date:** [August 12, 2022, 8:43am UTC](https://community.postman.com/t/i-am-unable-to-overwrite-the-content-type/38147/1 "2022-08-12T08:43:48Z")

</div>

**Your question may already have an answer on the community forum. Please search for related topics, and then read through the [guidelines](https://community.postman.com/t/about-the-just-getting-started-category/37) before creating a new topic.**

> Here’s an outline with best practices for making your inquiry.

_My question_:  
I try to overwrite the automatically generated content-type by application/json but I am not able to fix that. How can I do that? The information icon says use the body to control the value?

_Details (like screenshots)_:

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

_How I found the problem_:  
I am getting a 415 unsupported Media Type

_I’ve already tried_:  
Add content type in body and header.

---

<div class="post-metadata">

**Author:** ![jetison](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/jetison/32/12_2.png) [@jetison](https://community.postman.com/u/jetison)\
**Post date:** [August 12, 2022, 9:12pm UTC](https://community.postman.com/t/i-am-unable-to-overwrite-the-content-type/38147/2 "2022-08-12T21:12:55Z")

</div>

The information icon suggests “Use the request body tab to control the value or to remove this header”. Next to the **Headers** tab, find the **Body** tab where you can update the content type of the request body. For example, if you wanted `application/json`, select Raw , and then JSON. Postman will auto-generate the header according to the request body you configured under the **Body** tab.

 ![Screen Shot 2022-08-12 at 2.06.39 PM](https://us1.discourse-cdn.com/getpostman/original/2X/5/5f4727bd49fd92e90b0f688089ac37b8ab254685.png)

To overwrite an auto-generated header, you can’t edit the auto-generated values. However, you can add a new header, and de-select the auto-generated one.

---

<div class="post-metadata">

**Author:** ![crashandburnuk](https://avatars.discourse-cdn.com/v4/letter/c/e95f7d/32.png) [@crashandburnuk](https://community.postman.com/u/crashandburnuk)\
**Post date:** [March 29, 2023, 9:04am UTC](https://community.postman.com/t/i-am-unable-to-overwrite-the-content-type/38147/3 "2023-03-29T09:04:45Z")

</div>

This is such an appalling anti-feature. So unintuitive.

---

<div class="post-metadata">

**Author:** ![gwynethllewelyn](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/gwynethllewelyn/32/30275_2.png) [@gwynethllewelyn](https://community.postman.com/u/gwynethllewelyn)\
**Post date:** [August 1, 2023, 7:22pm UTC](https://community.postman.com/t/i-am-unable-to-overwrite-the-content-type/38147/5 "2023-08-01T19:22:07Z")

</div>

Hi, confused user here. 😕

The OP is making a PUT request, and their fix was simple enough (even if @crashandburnuk very correctly commented that this is not really very intuitive).

I have also found out that things are a bit easier when making a POST request. In that case, Postman _does_ respect the `Content-Type` header. At least, that’s what I’ve found out. That’s true even if the payload on the body is empty (length zero), which _technically_ would mean that the `Content-Type` would not apply (on the other hand, one might argue _ad infinitum_ that a payload of zero bytes _can_ have _any_ `Content-Type` — since zero bytes is a valid length for a payload 🙂 )

Now… how to accomplish the same with a GET request…?

For GET, Postman allows a payload to be sent (which is [not forbidden](https://stackoverflow.com/a/62808016/1035977)) and so it follows that it should be possible to set the `Content-Type` as well. However, Postman (as well as others, such as — allegedly — .NET) does not allow that type of configuration.

`curl` has no problem whatsoever, it’s totally agnostic to what you do or don’t do, so long as it’s not **explicitly forbidden** by the specs.

According to the specs, if one wants that the reply to a GET request to explicitly be in, say, JSON or XML (as opposed to the default, whatever that might be), one ought to place `Accept` headers indicating the content-type preference. Sadly, though, many (most?) APIs simply couldn’t care less about `Accept` headers, and just send whatever the server wants — unless the request does, indeed, specify `Content-Text`… which is not possible to configure in Postman for GET requests.

It seems to me that there is a slight inconsistency on Postman’s interpretation of the specs. Either GET _cannot_ have a payload, and _then_ the request body should be greyed out (and no `Content-Type` header is sent); or, like `curl` does, if a payload is allowed with GET, then setting the `Content-Type` should be possible, too — even if the body is empty!

I’m not an expert in interpreting the specs, mind you. Exchanging a few cool posts with Tim Berners-Lee when he announced his ‘cool new idea’ in the early 1990s does not make me an ‘authority’ 🙂

_(not really worth taking a look, but here’s the [link to my public workspace](https://www.postman.com/betatechnologies/workspace/just-for-asking-questions/collection/14772119-a92c9741-e173-42ea-be3a-d6b965e21c75?action=share&creator=14772119))_

---

<div class="post-metadata">

**Author:** ![daven333](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@daven333](https://community.postman.com/u/daven333)\
**Post date:** [August 2, 2024, 6:14pm UTC](https://community.postman.com/t/i-am-unable-to-overwrite-the-content-type/38147/6 "2024-08-02T18:14:45Z")

</div>

What if you want to just post form data that is NOT multipart/form-data, but a simple text only form? Makes no sense that it defaults to multipart forms when you check the “form-data” option, then you constantly have to manually change Content-Type. Why make things extra difficult?

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [August 2, 2024, 6:23pm UTC](https://community.postman.com/t/i-am-unable-to-overwrite-the-content-type/38147/7 "2024-08-02T18:23:28Z")

</div>

You could use this in the pre-request script to programmatically change the header:

> Insert the specified header name and value (if the header doesn’t exist, otherwise the already existing header will update to the new value):

```auto
pm.request.headers.upsert({key: headerName:String, value: headerValue:String}):function)

```

> **[Process data and script workflows using Postman JavaScript objects | Postman...](https://learning.postman.com/docs/tests-and-scripts/write-scripts/postman-sandbox-api-reference/#scripting-with-request-data)**
>
> Postman is a collaboration platform for API development. Postman's features simplify each step of building an API and streamline collaboration so you can create better APIs—faster.
