posva / mande

<700 bytes convenient and modern wrapper around fetch with smart extensible defaults
https://mande.esm.is
MIT License
1.2k stars 42 forks source link

Mande sets Content-Type: application/json for simple get requests. #396

Closed Higher08 closed 1 year ago

Higher08 commented 1 year ago

When using for simple GET request, like this: await api.get('group/' + groupId + '/channels') Mande sets Content-Type header with unsafe value of application/json, which issues preflight request. GET requests shouldn't have a body, so I think that header is unnecessary or at least optional. Can you fix this?

posva commented 1 year ago

You can set a different default header if you want or do it per request. https://github.com/posva/mande#usage