-
-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[Question] what advantage does axios give us over fetch? EOM #314
Comments
Overall they are very similar. Some benefits of axios:
|
I wrote a fetch implementation, which was inspired by axios, superagent, and request here https://github.com/glazedio/frisbee. I really do wish |
@niftylettuce I started this project before |
|
I see, I'm surprised the fetch guys haven't sorted this yet. |
Also as of right now |
Fetch does not support upload progress. Perhaps the information in this thread could be added to the readme? I think there are plenty of people who choose fetch over xhr just because it's the shiny new thing, and then have to refactor a bunch of code as they realise fetch doesn't support as many use cases as xhr does. |
@larsnystrom I also just now discovered axios because of So I think a comparison of two libraries on the front pages' readme would help people to choose one over the other. |
@mzabriskie One reason you might want to use fetch is if you want to make an offline-first app using Service Worker API: https://developers.google.com/web/fundamentals/getting-started/primers/service-workers With fetch you can add event listeners for Service Worker to intercept. Haven't found a way to do that with XHR yet. Can fetch support be added axios as an Adapter? |
According to http://caniuse.com/#search=fetch , the native support for fetch is fantastic now. |
Just FYI - my axios inspired implementation (that uses |
@niftylettuce and no "upload progress" right? |
@niftylettuce No, not always. You need permissions to run a WebSocket-server on your host. That’s not always a possibility. Many people have sites on cheap hosts with LAMP-stacks. Even when you have full control of your web host, the fact that you have to change your server-side code to deal with file uploads just because you decided to use fetch over XHR in the client should give paus for thought. |
There is great article about this:
|
not so great since it discusses only one minor difference as far as i see |
Axios interceptors for me. That is a breeze to setup configuration for global contents. |
No description provided.
The text was updated successfully, but these errors were encountered: