-
Notifications
You must be signed in to change notification settings - Fork 115
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
What does this library solve that fetch does not? #9
Comments
And what would be the benefits over libs like axios? |
my guess is that same api between node and browser? |
But |
The purpose of fetch is to be a low level primitive that libraries wrap; it's not really meant to be used directly. |
How does this library compare with @bitinn's node-fetch ? |
As far as I can see, it adds only two things over fetch:
And the rest is largely just recreating fetch's API. |
FWIW, one could also be interested in checking wretch https://github.com/elbywan/wretch which is also a tiny wrapper around fetch. |
Lots of thumbs down but @ljharb 's comment is accurate: Fetch's author specifically states he designed it as a low level HTTP/S client. Hence fetch doesn't use content types, encode query strings, etc. Personally I'd like to see a high level API with those things built on top of fetch. |
As this seems to be a common question, it would be nice to address it in the README |
The primary reasons I like r2 are that it is a very small nearly transparent library and you do not have to do two awaits to get the response data. e.g. |
for one, |
oh, actually node-fetch supports https / ca / cert and key: node-fetch/node-fetch#15 (comment) |
All it lacks is a citation... |
Google yielded https://medium.com/cameron-nokes/4-common-mistakes-front-end-developers-make-when-using-fetch-1f974f9d1aa1 , but a better source is https://jakearchibald.com/2015/thats-so-fetch/ |
No description provided.
The text was updated successfully, but these errors were encountered: