Skip to content

Repository files navigation

support support

request-libcurl

Small callback and Promise wrapper around node-libcurl for server-side transfers.

Install

npm install request-libcurl

Requires Node.js 22.15 or newer. Bun runtime is not supported because node-libcurl currently requires unsupported libuv APIs.

Quick start

import { requestAsync } from 'request-libcurl';

const { statusCode, headers, body } = await requestAsync({
  url: 'https://example.com/data.json',
  retry: false
});
import request from 'request-libcurl';

request({ url: 'https://example.com', retry: false }, (error, response) => {
  if (error) throw error;
  console.log(response.statusCode);
});
const { default: request, requestAsync } = require('request-libcurl');

Security default

TLS certificate verification remains disabled by default for compatibility. This permits man-in-the-middle attacks when the network or endpoint is untrusted. Enable verification for normal HTTPS traffic:

request.defaultOptions.rejectUnauthorized = true;
request.defaultOptions.rejectUnauthorizedProxy = true;

Documentation

License

BSD-3-Clause

About

⚡️ Extremely stable HTTP request module built on top of libcurl with retries, timeouts, async/await/promise and callback APIs

Topics

Resources

Code of conduct

Contributing

Stars

24 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages