You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current utils is an exact match which can lead to confusion when inserting headers on something like a POST (as I did) with 'Content-Type': 'application/json' because my matcher wouldn't match that against the automatically injected Accept header which makes it { 'Accept': 'application/json, text/plain, */*', 'Content-Type': 'application/json' }
The injected Content-Type header brings an additional issue: for calls without parameters, it defaults to "application/x-www-form-urlencoded", while requests with bodies set "application/json;charset=utf-8".
This means currently we have two set of headers depending on the endpoint we test:
Looking for design input here...
The current utils is an exact match which can lead to confusion when inserting headers on something like a
POST
(as I did) with'Content-Type': 'application/json'
because my matcher wouldn't match that against the automatically injectedAccept
header which makes it{ 'Accept': 'application/json, text/plain, */*', 'Content-Type': 'application/json' }
https://github.com/ctimmerm/axios-mock-adapter/blob/master/src/utils.js#L45
The text was updated successfully, but these errors were encountered: