Skip to content

http fetch api #7446

Closed
Closed

Description

@nojvek
  • 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 ?

Activity

  1. added
    feature requestIssues requesting new Node.js features.
    httpIssues and PRs related to the http subsystem.
    on Jun 27, 2016
  2. mscdex commented on Jun 27, 2016

    @mscdex
    Contributor

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

  3. cjihrig commented on Jun 27, 2016

    @cjihrig
    Contributor

    +1 to leaving this to userland.

  4. nojvek commented on Jun 27, 2016

    @nojvek
    Author

    no problem. Closing this.

  5. mbrevda commented on Aug 6, 2016

    @mbrevda

    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?

  6. jimmywarting commented on Nov 13, 2016

    @jimmywarting

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

  7. nojvek commented on Nov 13, 2016

    @nojvek
    Author

    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 <
    notifications@github.com> 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
    .

  8. sam-github commented on Nov 14, 2016

    @sam-github
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.httpIssues and PRs related to the http subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions