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

http fetch api #7446

Closed
nojvek opened this issue Jun 27, 2016 · 7 comments
Closed

http fetch api #7446

nojvek opened this issue Jun 27, 2016 · 7 comments
Labels
feature request Issues that request new features to be added to Node.js. http Issues or PRs related to the http subsystem.

Comments

@nojvek
Copy link

nojvek commented Jun 27, 2016

  • Version:
  • Platform:
  • Subsystem:

Now with fetch going mainstream as a browser api. Does it make sense to implement http.fetch method with the same interface to give isomorphic support?

I know there are modules, but doesn't this make sense being bundled as part of http api ?

@Fishrock123 Fishrock123 added feature request Issues that request new features to be added to Node.js. http Issues or PRs related to the http subsystem. labels Jun 27, 2016
@mscdex
Copy link
Contributor

mscdex commented Jun 27, 2016

IMHO this is best left to userland. There are a lot of browser APIs node does not implement.

@cjihrig
Copy link
Contributor

cjihrig commented Jun 27, 2016

+1 to leaving this to userland.

@nojvek
Copy link
Author

nojvek commented Jun 27, 2016

no problem. Closing this.

@nojvek nojvek closed this as completed Jun 27, 2016
@mbrevda
Copy link

mbrevda commented Aug 6, 2016

Considering the simplicity that fetch brings, along prevalence of higher level http fetch mechanisms in other languages (e.g. php's file_get_contents), and, now, it's ubiquity, I wonder if fetch doesn't deserve to be baked in?

@jimmywarting
Copy link

I want it even more now when we got async & await!!! It goes hand in hand like bread and butter.

@nojvek
Copy link
Author

nojvek commented Nov 13, 2016

I guess now with async await, node core api's should really have a promise
version of the api's as well. Or atleast a core api to map callback apis to
promise api.

The callback design from the start I think wasn't a great architectural
decision.

+1 on fetch being baked in. It should be a core JS engine API. (Both DOM
and Node)

On Sun, Nov 13, 2016 at 11:51 AM, Jimmy Karl Roland Wärting <
[email protected]> wrote:

I want it even more now when we got async & await!!! It goes hand in hand
like bread and butter.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#7446 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA-JVPSFA-TlO4h2fDMJv-P8lArEdb3sks5q92owgaJpZM4I_YUW
.

@sam-github
Copy link
Contributor

It's not the goal of core's http module that it have a high-level API like "other languages", its intended to be a low-level implementation of core HTTP protocol mechanisms, see https://www.npmjs.com/package/request and others for high level APIs. Its a strength of node's that due to node's use of npm, multiple HTTP APIs can co-exist, and that eventually when one is determined to not be the greatest anymore (perhaps it doesn't support Promises or work so well with async/await?), that in can be superceeded painlessly by a new, better API - which would not be possible if node core tried to balance being everything to everybody, including all new browser and language features as they are invented, and yet somehow also being backwards compatible forever.

If the browser's fetch API can't be implemented in as an npm module because of some lack in node core, that is something that should be addressed, but there isn't any sign of that yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

No branches or pull requests

7 participants