Skip to content

Replace "request" with something else #2672

Description

@bajtos

request module is moving to maintenance mode, we should eventually find a new HTTP client.

I tried to upgrade to got. got works well for simple use cases, but stops working for non-trivial requests (e.g. when a proxy is involved). What's worse, it replaces errors reported by Node.js core with its own error classes, which makes troubleshooting extremely difficult 😞 It seems that other popular clients like node-fetch and axios are doing the same mistake 😞

(UPDATED on Jun 12, 2019)

Acceptance Criteria

  • Review request alternatives (e.g. axios and node-fetch), find one that meets the following requirements:
    • It should preserve low-level stack traces reported by Node.js instead of thrown fresh error instances
    • It need to support proxies, ideally @loopback/http-caching-proxy too.
    • If it's browser-friendly, then we should choose something that's more compatible with node-fetch API.

It can be a reusable component/module where we can customize the behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions