Automatically set content-type: application/json when the body is set to json

Feature Request
Coming from Postman and Insomnia, I spent a little while debugging 415 errors before I realized Yaak doesn't do this.
Obviously I should still be able to override it by manually setting the header, but a transparent default would be nice.
Hmm, the header gets added to the request headers when you set the body type to JSON. How did you create the request (manually, import, etc)?
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
Should have a fix for this in today's beta release
Gregory Schier Just tried it out, can confirm it works. Thanks!
https://yaak.app/blog/2024.8.0