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:
-
Create a new request
-
Change the body type to JSON
-
Content-Type: application/json gets added
-
Change the body type to “No Body”
-
Header is removed
-
Change the body type to JSON
-
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:
-
Create a new request
-
Change the body type to JSON
-
Content-Type: application/json gets added
-
Change the body type to XML
-
Header is not changed to text/xml
-
Change the body type to “No Body”
-
Header is removed
-
Change the body type to JSON
-
Header is not added back
Read more here: Source link
