package
Synchronous HTTP request library.
npm install retusGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Synchronous HTTP request library.
npm install retusconst retus = require("retus");
const { body } = retus("https://google.com");
//=> "<!doctype html>..."Type: string
The URL to fetch.
Type: object
Type: "get" | "head" | "post" | "put" | "delete" | "connect" | "options" | "trace" | "patch"
Default: get
The HTTP method.
Type: string
The URL to prefix the request url with.
Type: number
Default: 2
The retry limit.
Type: number
Default: 0
The delay between retries.
Type: number | false
Default: 10000
The timeout in milliseconds for getting a response. If set to false a timeout won't be set.
Type: "text" | "json" | "none"
Default: text
The type of data returned by the url. Set to none to return raw data.
Type: object<string, string | number | boolean>
The search parameters for the request.
Type: object
The JSON to send with the request. If specified, responseType automatically defaults to json.
Type: object<string, string | string[] | undefined>
The headers to send with the request.
Type: string
The body to send with the request.
Type: boolean
Default: false
Throw an error if the status code is 4xx or 5xx.
Sets option.method to the method name and sends the request.
Create a new Retus instance with the provided default options.
Create a new Retus instance, extending the current default options with the provided ones.
An error that is thrown when the HTTP status code is 4xx or 5xx.
Estimated unpacked size across 16 packages.
3.3 MB
Includes dependencies.