HttpRequest
An immutable request: method, URL, headers and an optional body.
Stable Core. Built with the factory HttpRequest(method, url) { headers = ...; body = ... }. The factory refuses, with IllegalArgumentException and in this order: the method CONNECT; a header value that is not sendable (HTAB or U+0020..U+007E); a body on GET, HEAD or TRACE; a body with a content type beside a Content-Type header. Equality is identity. toString() prints the method, the redacted URL, the header names and the body's size, never a header value or the body.
Types
Link copied to clipboard
Collects the optional parts of an HttpRequest. Not thread-safe; use it only inside the factory's lambda.