Makes a one-shot streamed HTTP request.
The returned response must be fully consumed or explicitly closed.
@eryx/http/request ModuleMakes a one-shot streamed HTTP request.
The returned response must be fully consumed or explicitly closed.
The HTTP method (e.g. "GET", "POST").
The full URL including scheme and host.
Request options.
The streamed response.
Convenience wrapper for a GET request.
The full URL to request.
Request options.
The parsed response.
Convenience wrapper for a POST request.
The full URL to request.
The request body string.
Additional request options.
The parsed response.
Convenience wrapper for a PUT request.
The full URL to request.
The request body string.
Additional request options.
The parsed response.
Convenience wrapper for a DELETE request.
The full URL to request.
Request options.
The parsed response.
Convenience wrapper for a HEAD request.
Returns headers only - the body will be empty.
The full URL to request.
Request options.
The parsed response (body is empty).
Raises an error for HTTP 4xx and 5xx responses.
A buffered HTTP response.
The same response when the status is not an error.
Decodes a buffered response body as JSON.
A buffered HTTP response.
The decoded JSON value.
Decodes a buffered response body as application/x-www-form-urlencoded.
A buffered HTTP response.
The decoded form fields.
Decodes a buffered response body as multipart/form-data.
The response must include a content-type header with a boundary
parameter.
A buffered HTTP response.
The decoded multipart fields.
Incremental upload source. When provided, the request body is read
chunk-by-chunk from read(size?).
Exact byte length for bodyStream. When omitted, chunked request
framing is used automatically.
Form fields encoded as application/x-www-form-urlencoded.
When provided, the request body is generated automatically unless
body is also set, which is treated as an error.
JSON payload encoded with @eryx/encoding/json.
Multipart form fields encoded as multipart/form-data.
Applies the same timeout to connect, read, and write phases.
Timeout used while opening the TCP/TLS connection.
Timeout used while waiting for response bytes.
Timeout used while sending request headers and body bytes.
Maximum number of redirects to follow. Set to 0 to disable redirect following. Defaults to 10.
Automatically decompress gzip/deflate response bodies and send
Accept-Encoding. Set to false to receive raw compressed bytes.
Defaults to true.
A CookieJar for automatic cookie handling. When provided,
matching cookies are sent with the request and Set-Cookie
response headers are stored in the jar.