http_request
Make an HTTP/HTTPS request with full control over method, headers, body, authentication, proxy, and TLS settings. Supports GET, POST, PUT, DELETE, PATCH, HEAD, and OPTIONS methods. Includes proxy support (HTTP, HTTPS, SOCKS4, SOCKS5, SOCKS5H) and built-in Tor integration for anonymous requests. Returns status code, response headers, body, timing information, and redirect details. Use 'output' parameter to control body format: 'text' for UTF-8, 'base64' for binary content, 'json' for parsed JSON.
Usage Example
Parameters
Required
urlstringrequiredThe full URL to request, including protocol (e.g., 'https://api.example.com/data'). Supports http:// and https:// protocols.
Optional
methodenumGETPOSTPUTDELETE+3 moreHTTP method to use. Options: 'GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS'. Default: 'GET'
headersstringHTTP headers as a JSON object (e.g., {"Content-Type": "application/json", "X-Custom": "value"}) or as a string with one header per line. Each key-value pair becomes a request header.
bodystringRequest body content. For JSON APIs, pass a JSON string and set Content-Type header to 'application/json'. For form data, use URL-encoded format with Content-Type 'application/x-www-form-urlencoded'.
cookiesstringCookies to send with the request. Accepts either a string in 'name=value; name2=value2' format, or a JSON array of cookie objects from browser_get_cookies (e.g., [{"name": "session", "value": "abc"}, ...]). When using the array format, only 'name' and 'value' fields are used.
auth_typeenumnonebasicbearerdigestAuthentication type. Options: 'none', 'basic', 'bearer', 'digest'. Default: 'none'
auth_usernamestringUsername for basic or digest authentication.
auth_passwordstringPassword for basic or digest authentication.
auth_tokenstringBearer token for bearer authentication (without 'Bearer ' prefix).
proxy_typeenumhttphttpssocks4socks5+1 moreType of proxy server. Options: 'http', 'https', 'socks4', 'socks5', 'socks5h'. Use 'socks5h' for remote DNS resolution (recommended for privacy).
proxy_hoststringProxy server hostname or IP address.
proxy_portstringProxy server port number.
proxy_usernamestringUsername for proxy authentication.
proxy_passwordstringPassword for proxy authentication.
use_torbooleanUse built-in Tor proxy (SOCKS5H at 127.0.0.1:9050) for anonymous requests. Overrides any proxy settings. Default: false
follow_redirectsbooleanFollow HTTP redirects automatically. Default: true
max_redirectsstringMaximum number of redirects to follow. Default: 10
timeoutstringTotal request timeout in milliseconds. Default: 30000 (30 seconds)
connect_timeoutstringConnection timeout in milliseconds. Default: 10000 (10 seconds)
ssl_verifybooleanVerify SSL/TLS certificates. Set to false for self-signed certificates. Default: true
ca_cert_pathstringPath to custom CA certificate bundle file (.pem) for SSL verification.
user_agentstringCustom User-Agent header string. Overrides default.
outputenumtextbase64jsonResponse body output format. 'text' for UTF-8 text, 'base64' for binary content encoded as base64, 'json' to attempt JSON parsing. Default: 'text'
Response
Returns a JSON object with the operation result.
{
"success": true,
"result": <value>
}