Abort an in-flight asynchronous request.
Get the current request headers as an array of "Name: Value" strings.
Get request statistics
RequestInfo Request statistics
Stream callback. Return true to abort reading.
Observe libcurl debug events. Passing a function enables CURLOPT_VERBOSE internally but does not write verbose output to stderr. The data argument is raw bytes; HEADER_* events can be decoded as UTF-8, DATA_* and SSL_DATA_* may be binary.
Set header callback function
Header callback function
Current CURL instance (supports chaining)
Set callback fired once when response headers are complete. Receives (status: number, headersRaw: string). Enables streaming: set this + onData to get body chunks before perform() resolves.
Set progress callback function
Progress callback function
Current CURL instance (supports chaining)
Pause receive stream
Reset CURL instance to initial state
Resume receive stream
Enable or set accepted compressed response encodings.
Optionalencoding: stringSet HTTP Basic authentication credentials.
Optionalpassword: stringSet bearer token authentication.
Set request body (for POST/PUT, etc.)
Request body string
Current CURL instance (supports chaining)
Set CA certificate bundle path
CA certificate file path
Current CURL instance (supports chaining)
Set connection timeout (milliseconds)
Connection timeout in milliseconds
Current CURL instance (supports chaining)
Set cookie string
Cookie string
Current CURL instance (supports chaining)
Set cookie file path
Cookie file path
Current CURL instance (supports chaining)
Set cookie jar output path.
Set DNS server list (comma-separated)
DNS server list (e.g., "8.8.8.8,1.1.1.1")
Current CURL instance (supports chaining)
Set whether to follow redirects
Whether to follow redirects
Current CURL instance (supports chaining)
Set HTTP request headers
Headers object
Current CURL instance (supports chaining)
Set HTTP protocol version
HTTP version (1.0, 1.1, 2, 2TLS, 3)
Current CURL instance (supports chaining)
Set network interface
Network interface name or IP address
Current CURL instance (supports chaining)
Enable TCP keepalive, optionally setting idle and interval seconds.
Optionalidle: numberOptionalinterval: numberAbort transfers slower than limit bytes/sec for time seconds.
Optionaltime: numberSet maximum redirect count
Maximum redirects
Current CURL instance (supports chaining)
Set HTTP method
HTTP method (GET, POST, PUT, HEAD, DELETE, etc.)
Current CURL instance (supports chaining)
Set a libcurl easy option by numeric id. Unsafe pointer options are rejected.
Set proxy server
Proxy server address (e.g., http://proxy.example.com:8080)
Optionaltype: "http" | "https" | "socks4" | "socks4a" | "socks5" | "socks5h"Proxy type (http, https, socks4, socks5)
Current CURL instance (supports chaining)
Set request range (for resumable downloads)
Start byte position
Optionalend: numberEnd byte position (optional, defaults to end of file)
Current CURL instance (supports chaining)
Set referer header
Referer value
Current CURL instance (supports chaining)
Attach a libcurl share handle for cookies, DNS, SSL sessions, and connections.
Set SSL/TLS verification
Whether to verify peer certificate
OptionalverifyHost: booleanWhether to verify hostname (defaults to verifyPeer)
Current CURL instance (supports chaining)
Set streaming mode. Don't save body, trigger ondata instead
Streaming mode
Set timeout (milliseconds)
Timeout in milliseconds
Current CURL instance (supports chaining)
Upload raw data using libcurl's read callback.
Upload a file path using libcurl's file reader.
Set request URL
Request URL
Current CURL instance (supports chaining)
Set user agent string
User agent string
Current CURL instance (supports chaining)
Set whether to enable verbose output
Whether to enable verbose output
Current CURL instance (supports chaining)
CURL class - Represents a single HTTP request
Example