application/json when the body is set to json

Gregory Schier I think the request was duplicated from one that was imported from Insomnia v7.

Trying out with new requests, I can confirm the header is indeed set automatically, but it only appears to happen the very first time the body type is changed.

Here are my repro steps:

  1. Create a new request

  2. Change the body type to JSON

  3. Content-Type: application/json gets added

  4. Change the body type to “No Body”

  5. Header is removed

  6. Change the body type to JSON

  7. Header is not added back

I’ve also tested the same flow with XML bodies with a similar result (Content-Type: text/xml is set only the first time).

More generally, the header isn’t getting set to anything after the first body change. Here’s another flow I tested:

  1. Create a new request

  2. Change the body type to JSON

  3. Content-Type: application/json gets added

  4. Change the body type to XML

  5. Header is not changed to text/xml

  6. Change the body type to “No Body”

  7. Header is removed

  8. Change the body type to JSON

  9. Header is not added back

Read more here: Source link