Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discrepancy in response data #21

Closed
David5280 opened this issue Apr 20, 2020 · 3 comments
Closed

discrepancy in response data #21

David5280 opened this issue Apr 20, 2020 · 3 comments
Labels
bug Something isn't working compat Compatibility issue has fix A fix is PR'd or merged, but not yet released

Comments

@David5280
Copy link

Hey there,

I'm trying to convert some axios requests to redaxios and I'm noticing a discrepancy in the responses. The data object coming back from redaxios is stringified, whereas the data object I currently receive with axios is valid JSON. I am wondering if it would make sense to do this conversion in redaxios so that it is truly a drop-in replacement of axios?

Looking forward to hearing your thoughts, thanks!

@developit
Copy link
Owner

Ah - I'm guessing Axios inspects the response headers and determines when JSON should be used rather than text. I think we can add that here. Good catch!

@developit developit added bug Something isn't working compat Compatibility issue labels Apr 20, 2020
@hasan-wajahat
Copy link

Actually the default value for responseType in axios is json. So to match the API of axios, redaxios should do the same.

@developit developit added the has fix A fix is PR'd or merged, but not yet released label Jul 23, 2020
@developit
Copy link
Owner

Thanks for the tip @hasan-wajahat - I actually had read that wrong in the docs (I've never used Axios!). I amended the solution from #26 based on your comment.

This issue is now fixed in version 0.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compat Compatibility issue has fix A fix is PR'd or merged, but not yet released
Projects
None yet
Development

No branches or pull requests

3 participants