[HTTP]RequestThe request Builder. Convenience methods on [HTTP]Client cover the common cases; a library reaches for this to set a custom verb, headers, body, or insecure:. The setters return self so calls can be threaded.
Parse 'scheme://host[:port]/path' into #( scheme host port path ). Port defaults by scheme; path defaults to '/'. Query (if any) rides in path.
[HTTP]Request.parseUrl:'https://example.org/docs/intro?lang=qn' "* -> #(https example.org 443 /docs/intro?lang=qn)
Resolve a Location header against the request URL: an absolute URL is used as-is; '/path' is root-relative to the base's scheme://host:port; anything else is relative to the base path's directory.
[HTTP]Request.resolveLocation:'/login' against:'https://example.org/a/b' "* -> https://example.org:443/login
The normalized request body as an [HTTP]Body (or nil if none was set).
Set the body, normalizing a shortcut into an [HTTP]Body: a Map/List is JSON-encoded (Content-Type application/json), a String is its UTF-8 bytes, Bytes is taken as-is, and an already-built [HTTP]Body is used directly. The convenience [HTTP]Client.post: helpers flow through here, so post:url body:aMap auto-encodes.
Whether send follows 3xx redirects (default true); returns self.
Append one request header pair; returns self.
Replace the header list with pairs — #(name value) each; returns self.
Internal: builder defaults — GET, no headers or body, TLS verified, redirects followed up to 10.
Skip TLS certificate verification (self-signed test hosts); returns self.
One request/response cycle (no redirect following): connect, send, read the head, and return an [HTTP]Response whose body is a stream-backed [HTTP]Body. The socket is NOT closed here — it stays open, owned by the body, and closes when the body is drained (.text/.json/.bytes), fully iterated (.chunks/.each:), .close'd, or GC-reaped. Throws (catchable) on connection errors or a malformed head; the stream is closed before re-raising.
Cap the redirects send will follow before throwing (default 10); returns self.
Set the request verb (e.g. 'PUT'); returns self.
Build the next request for a redirect response: resolve its Location against this request's URL, carry over insecure/followRedirects/maxRedirects and the headers, and adjust the method/body per status. 307/308 preserve method+body; 303 (and a 301/302 from a non-GET/HEAD method) become a bodyless GET.
Serialize the request to Bytes for a given Host header value.
Send the request, following redirects (3xx + Location) up to @maxRedirects when @followRedirects is set (the default). Each redirect response's body is discarded; exceeding the cap throws. With following off, the 3xx response is returned as-is.