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
Which is true, since response.data is an object, when the server replies with JSON.
But, response.data is also a string, when config.responseType is either undefined or json, despite the server replying with anything but JSON.
That behavior is welcome, but I don't see where in either of http or xhr adapters this is specified ?
As I'm writing an adapter for Tauri and forgot to reproduce this behavior, I'd like to know exactly is it made in official adapters, and if there's other logic I should know about, in order to be as accurate as possible to the original axios experience.
Additionally, I think it would be interesting to make dev-oriented resources on how to make adapters in general (especially for preserving the original features and experience), as I found none and had to improvise it, like anyone who ever done that I guess.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
The README says that the default value for
config.responseType
isjson
.Which is true, since
response.data
is an object, when the server replies with JSON.But,
response.data
is also a string, whenconfig.responseType
is eitherundefined
orjson
, despite the server replying with anything but JSON.That behavior is welcome, but I don't see where in either of
http
orxhr
adapters this is specified ?As I'm writing an adapter for Tauri and forgot to reproduce this behavior, I'd like to know exactly is it made in official adapters, and if there's other logic I should know about, in order to be as accurate as possible to the original
axios
experience.Additionally, I think it would be interesting to make dev-oriented resources on how to make adapters in general (especially for preserving the original features and experience), as I found none and had to improvise it, like anyone who ever done that I guess.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions