Feature request: fetch based adapter
See original GitHub issueI didn’t see an issue for this (opened or closed), but if this is a duplicate just close it 😸 .
Are there any plans for a fetch
based adapter for axios? I thought I’d check and see if this has been discussed, and if not, if you all would be open to a feature request (or I’m happy to work on it and PR it).
Reasons for adding a fetch
adapter are basically for the same reasons you’d use fetch:
- Support for service workers
- Integration with Cache API
- natively promise based, so axios can become a thinner library
- response streaming
- probably more that I’m not even thinking of right now
Reasons you’d still want axios wrapping fetch for you (because some people feel like you don’t need a lib over fetch):
- fetch is low level. Using plain fetch in an app that is 99% GET/PUT/POST against a JSON API means lots of duplicate boilerplate code which axios can abstract
- request/response interceptors
- probably more that I’m not even thinking of right now 😄
Issue Analytics
- State:
- Created 6 years ago
- Reactions:118
- Comments:43 (2 by maintainers)
Top Results From Across the Web
fetch() - Web APIs | MDN
The global fetch() method starts the process of fetching a resource from the network, returning a promise which is fulfilled once the response...
Read more >Axios vs. fetch(): Which is best for making HTTP requests?
The fetch() API is perfectly capable of reproducing the key features of Axios, and it has the added advantage of being readily available...
Read more >axios-fetch-adapter - npm Package Health Analysis - Snyk
Ensure you're using the healthiest npm packages. Snyk scans all the packages in your projects for vulnerabilities and provides automated fix advice.
Read more >Adapter - 4.7 - Ember API Documentation
An adapter is an object that receives requests from a store and translates ... Typically the adapter is not invoked directly instead its...
Read more >DataHub Feature Requests
Vote or request new DataHub Feature Requests features. Subscribe to get updates about new features from DataHub Feature Requests.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Agreed. This looks like a dealbreaker for using Axios in PWAs, because the serviceworker can only intercept and cache http requests sent via the
fetch
api.Discussed in https://github.com/axios/axios/issues/484
this is embarrassing and sad