Closed yujinyuz closed 1 month ago
And there is a problem if the last request is json and then if you run another request without accept: application/json, it becomes plaintext and you'll get an error in treesitter
Will try to fix that.
I just want to have all the requests have Accept: application/json because most of them are JSON anyways.
Afaik the http spec does not allow/enable us to do so, but I'm quite intrigued by the idea.
Maybe we can have a separate file like the http-client.env.json
and call it http-client.headers.json
There we could put default headers.
The file would be completely optional. It would be also possible to override these headers on a per request basis.
On thing I'm not quite sure about is, if this headers file should be structured as the env filez so that you can have different headers for each environment..?!
What do you think?
@gorillamoe
I don't have any opinions on the http-client.headers.json
but I just got that idea from an insomnia plugin that I was using before (think it was merged into core)
where if you create an Environment
and add the headers inside DEFAULT_HEADERS
it would automatically pick it up and will get overridden if a header is provided
I think we should add it to the http-client.env.json then.
Thanks for the example and explanation.
Currently working on it.
I just want to have all the requests have
Accept: application/json
because most of them are JSON anyways.And there is a problem if the last request is
json
and then if you run another request withoutaccept: application/json
, it becomesplaintext
and you'll get an error in treesitter