Skip to content

iexitdev/request-modern

request-modern

Fetch-backed migration client for code moving away from request.

request is deprecated. This package preserves the most common request-shaped call patterns while returning modern Response objects and typed result helpers.

Install

npm install request-modern

Usage

import request, { get, post } from "request-modern";

const response = await get("https://example.com");
const json = await request.json("https://api.example.com/data");

request("https://example.com", (error, response, body) => {
  if (error) throw error;
  console.log(response.statusCode, body);
});

API

  • request(urlOrOptions, callback?)
  • get(urlOrOptions, callback?)
  • post(urlOrOptions, callback?)
  • request.text(urlOrOptions)
  • request.json(urlOrOptions)

Migration Position

request-modern is an independent alternative or migration helper for projects moving away from request. It is not affiliated with the original package maintainers or project.

For release context, see the local migration guide, examples, compatibility notes, source metadata, and adoption plan.

About

Fetch-backed request migration client with callback and promise APIs.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors