Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 436 Bytes

File metadata and controls

17 lines (12 loc) · 436 Bytes

Examples

request-modern is an independent package. It is not affiliated with request or its maintainers.

request to request-modern

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

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

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