UNPKG

sync-request-curl

Version:

Fast way to send synchronous web requests in NodeJS. API is a subset of sync-request. Leverages node-libcurl for high performance. Cannot be used in a browser.

12 lines (11 loc) 541 B
import { HttpVerb, Options, Response } from './types'; /** * Performs an HTTP request using cURL with the specified parameters. * * @param {HttpVerb} method - The HTTP method for the request (e.g., 'GET', 'POST') * @param {string} url - The URL to make the request to * @param {Options} [options={}] - An object to configure the request * @returns {Response} - HTTP response consisting of status code, headers, and body */ declare const request: (method: HttpVerb, url: string, options?: Options) => Response; export default request;