I just spend quite some time trying to figure out why the JSON content of a response would not be formatted and the filetype is set to plaintext instead.
As it turned out the problem was that I set in my request a capitalized header field.
This formats the output and sets the correct filetype:
GET https://api.isevenapi.xyz(api/iseven/12/
accept: application/json
This does not:
GET https://api.isevenapi.xyz(api/iseven/12/
Accept: application/json
I just spend quite some time trying to figure out why the JSON content of a response would not be formatted and the filetype is set to plaintext instead. As it turned out the problem was that I set in my request a capitalized header field. This formats the output and sets the correct filetype:
This does not:
According to the spec https://www.rfc-editor.org/rfc/rfc9110.html#name-field-names header fields are case-insensitive, so capitalizing them, as is quite common, should not lead to such problems.