scoop:scoop.http:0.1.0
scoop.http
API
-
class
AwsEventStreamDecoder
An incremental AWS EventStream decoder with one pending message and no network I/O.
- enum AwsEventStreamErrorKind
-
class
AwsEventStreamException
A wire error located at a byte offset within the current message.
-
class
AwsEventStreamHeader
One strictly decoded, case-sensitive header name and its typed value.
-
enum
AwsEventStreamHeaderValue
The fixed AWS EventStream wire header types, with exact integer widths.
-
class
AwsEventStreamMessage
One complete, checksum-verified message; payload interpretation belongs to the caller.
-
enum
Http1AfterClose
Controls handling of additional input after a message declared that the connection closes.
-
struct
Http1BodyChunk
The bytes surrounding one accepted body prefix; the payload itself stays with the caller.
-
enum
Http1BodyFraming
The explicit body-delimiting rule selected before encoding an HTTP/1 message.
-
class
Http1Decoder
An incremental in-memory HTTP/1 decoder. Register client request methods in order, feed bytes, and drain events; serialize operations on one instance and close it explicitly.
-
class
Http1Encoder
An HTTP/1 encoder with explicit message begin, body, and finish. It produces framing bytes without performing transport I/O; close does not finish a message.
-
enum
Http1Event
One decoded HTTP/1 event. A message head is followed by body/trailer events and End; Switch marks transfer to another protocol.
-
struct
Http1Limits
Local HTTP/1 header and start-line byte limits; all limits must be positive.
- class Http1LimitsBuilder
-
struct
Http1ReceiveOptions
Explicit llhttp receive-compatibility options. They do not relax outgoing validation or extend the server parser's known-method set; defaults preserve strict framing.
- class Http1ReceiveOptionsBuilder
-
struct
Http1ReceiveResult
Input bytes consumed and messages started in this call, including partial start lines and informational responses; zero input yields two zero counts.
-
enum
Http2Event
An HTTP/2 stream or connection event. Data consumption and outgoing bytes must be driven separately through the session.
-
struct
Http2InputProgress
A stream ID and newly attributed HEADERS/CONTINUATION/DATA input bytes, including framing and padding. This measures protocol progress, not decoded body length.
-
enum
Http2InvalidRegularField
Policy for an invalid received regular field; pseudo-field validation remains protocol-defined.
-
struct
Http2Limits
Positive local header, continuation, outgoing-header, and buffered-body limits. These are distinct from advertised HTTP/2 SETTINGS.
- class Http2LimitsBuilder
-
struct
Http2OutputChunk
The byte count copied into the output buffer, associated stream ID, and output category.
-
enum
Http2OutputKind
Identifies control, header, or DATA bytes copied out of a session.
-
struct
Http2ReceiveOptions
Receive-only compatibility for field-edge whitespace and invalid regular fields; outgoing fields remain strictly validated.
- class Http2ReceiveOptionsBuilder
-
struct
Http2ReceiveResult
Total consumed input bytes together with per-stream input progress.
-
struct
Http2RequestIndexing
Never-index flags for the method, scheme, authority, and path pseudo-fields. True requests that the corresponding value not enter the compression table.
-
class
Http2Session
An owned in-memory HTTP/2 session. Serialize calls, drain events and output, and acknowledge received DATA only after consumption. It owns no network transport.
-
struct
Http2Setting
One numeric HTTP/2 setting identifier and unsigned value.
-
struct
Http2Settings
Values advertised to the peer for header tables, concurrent streams, stream windows, frame size, and header-list size. Clients disable server push.
- class Http2SettingsBuilder
-
class
HttpAcceptEncoding
Parsed content-coding preferences with explicit identity and wildcard rules.
-
class
HttpAge
A nonnegative Age field value in seconds, retaining original input when parsed.
-
class
HttpAuthChallenge
One authentication challenge with a scheme and token68 or named parameters; parsing alone does not authenticate credentials.
-
class
HttpAuthenticationInfo
Authentication response parameters, such as Digest response-authentication information.
-
enum
HttpByteRange
A closed interval, open-ended interval, or suffix byte-count request.
-
class
HttpCacheControl
Ordered Cache-Control directives, including duplicates and original field values. Interpretation is explicit; single rejects duplicated directives.
-
class
HttpCacheDirective
A normalized directive name and optional raw argument. Numeric and field-list interpretation validate their own grammar.
-
class
HttpCleartextProbe
Incrementally distinguishes the HTTP/2 client preface from HTTP/1, retaining consumed prefix bytes and leaving the remaining input untouched.
-
class
HttpContentDisposition
A disposition token with unique parameters. Filename interpretation is explicit and does not sanitize a filesystem path.
-
class
HttpContentRange
A Content-Range value with an optional satisfied interval and optional complete representation length.
-
class
HttpCookie
A resolved cookie with host/path scope, expiry, and flags. URL matching and SameSite decisions are separate operations.
-
class
HttpCookieAttribute
One Set-Cookie attribute name and optional value, retaining byte-oriented syntax.
-
object
HttpCookieDate
Cookie-date parsing, including accepted historical forms, and HTTP-date formatting.
-
class
HttpCookieHeader
An ordered sequence of cookie name/value pairs for the Cookie field.
-
class
HttpCookiePair
A copied cookie name/value byte pair with cookie syntax validation.
-
enum
HttpCookieRejection
Why a parsed Set-Cookie cannot be accepted for its response URL.
-
object
HttpCookieRules
Pure helpers for schemeful site, domain, and cookie-path matching.
-
enum
HttpCookieSameSite
SameSite policy associated with a cookie.
-
class
HttpCredentials
An Authorization value with an authentication scheme and token68 or named parameters.
-
object
HttpDate
HTTP-date parsing and canonical IMF-fixdate formatting in GMT.
-
class
HttpEncodingPreference
One normalized content-coding preference, after resolving duplicate entries.
-
class
HttpEntityTag
An opaque entity tag with an optional weak marker. Weak and strong comparisons are explicit.
-
class
HttpEntityTagCondition
A conditional entity-tag list or wildcard for If-Match and If-None-Match.
-
class
HttpException
A protocol failure carrying operation, backend code, affected scope, stream identity, and unexpected-EOF information.
-
struct
HttpExpectations
The standard Continue signal and presence of other syntactically valid expectations.
-
class
HttpExtendedValue
Decoded extended-parameter text together with its language tag and selected charset.
-
enum
HttpFailureScope
The protocol state affected by a failure.
-
class
HttpField
An owned snapshot of HTTP field name and value bytes. Duplicate fields and original ordering remain distinct; text decoding is explicit.
-
class
HttpFieldParseException
A structured-field syntax or interpretation error, retaining the field name and zero-based source byte offset.
- class HttpFieldsBuilder
-
class
HttpFilename
The selected filename text/language and any failure decoding filename*, retained when falling back to filename.
-
struct
HttpHeaderLimits
Positive local limits on total header bytes, one field's bytes, and field count. These are enforced independently of peer-advertised settings.
- class HttpHeaderLimitsBuilder
-
class
HttpLocation
A parsed Location URL reference, preserving original bytes and requiring a base URL for relative resolution.
-
class
HttpMediaType
A normalized media type/subtype with unique named parameters and optional original field bytes.
-
class
HttpNegotiationException
HTTP protocol negotiation failed for the named operation.
-
class
HttpParameter
A normalized parameter name, decoded value bytes, and whether quoted-string syntax was used.
-
enum
HttpPreconditionResult
The result of evaluating origin request preconditions for a selected representation.
-
enum
HttpProtocol
The HTTP framing family selected for a connection.
-
class
HttpRange
An ordered nonempty set of byte-range requests. Resolve against the representation size before serving bytes.
-
class
HttpRangeResolution
The satisfiable resolved byte intervals and whether any requested range can be served.
-
class
HttpRequestHead
An owned request head with method bytes, protocol-specific target, ordered regular fields, and HTTP/2 indexing hints.
-
enum
HttpRequestTarget
The protocol-specific request-target representation.
-
class
HttpResolvedRange
A validated nonnegative inclusive byte interval whose length fits Long.
-
class
HttpResponseHead
An owned response head with status, ordered fields, and an optional HTTP/1 reason phrase. HTTP/2 responses have no reason phrase.
-
enum
HttpRetryAfter
A retry delay expressed as an absolute HTTP date or nonnegative delta seconds.
-
enum
HttpRole
Selects client or server responsibilities for parsing, framing, and masking.
-
class
HttpSetCookie
One Set-Cookie field with its ordered attributes and interpreted cookie properties. Resolve against the response URL before storing it.
-
class
HttpTrailerDeclaration
The names declared in Trailer, with explicit validation of received or outgoing trailer fields.
-
class
HttpVary
The request-field names affecting representation selection, or a wildcard that prevents ordinary cache matching.
-
enum
HttpVersion
The protocol version represented by a message head.
-
class
MultipartBoundary
A validated multipart boundary of 1..70 permitted ASCII characters with no trailing space.
-
class
MultipartDecoder
An incremental multipart parser with bounded headers, parts, and body events. Drain an event before feeding more input; calls on one instance must not overlap.
-
class
MultipartEncoder
An in-memory multipart writer with explicit beginPart, body, endPart, and final finish. It performs no transport I/O and close does not emit a closing boundary.
-
enum
MultipartEvent
Ordered multipart part, data, and completion events.
-
class
MultipartLimitException
Multipart input exceeded a configured local limit.
-
enum
MultipartLimitKind
The multipart parsing limit that was exceeded.
-
class
MultipartLimits
Local limits for part headers, field counts, part counts, boundary padding, and emitted data-chunk size. Counts may be zero; chunk size must be positive.
- class MultipartLimitsBuilder
-
class
MultipartParseException
Malformed multipart syntax at a zero-based stream byte offset.
-
class
MultipartPartHead
Validated part fields and an optional declared body length used by the encoder; parsed incoming heads do not infer a body length.
-
class
NdjsonDecoder
Incremental UTF-8 NDJSON record framing; JSON interpretation belongs to the caller.
- enum NdjsonFramingErrorKind
-
class
NdjsonFramingException
A record boundary failure at a zero-based byte offset within the current record.
-
class
PublicSuffixList
An in-memory public-suffix rule set supporting exact, wildcard, exception, and optional private-section rules. Lookup performs no network update.
-
class
PublicSuffixMatch
The normalized domain, effective public suffix, optional registrable domain, and matched rule metadata.
-
class
PublicSuffixParseException
A malformed public-suffix rule with source line and optional cause.
-
class
SseDecoder
An incremental UTF-8 event-stream parser with bounded line and event data. It tracks event IDs and retry hints but performs no reconnection or network I/O.
-
class
SseEncoder
An incremental encoder for one SSE message or comment block, with bounded output state.
-
class
SseEvent
One dispatched server-sent event, including its type, joined data lines, and event-ID state.
-
class
SseLimitException
SSE input exceeded the named configured byte limit.
-
enum
SseLimitKind
The SSE input limit that was exceeded.
-
class
SseLimits
Nonnegative byte limits for an SSE line and accumulated event data.
- class SseLimitsBuilder
-
class
SseMessage
One outbound SSE block; absent fields differ from explicitly empty fields.
-
class
WebSocketClose
A validated optional close status and UTF-8 reason. Serialization enforces legal wire codes and the control-frame payload limit.
-
class
WebSocketDeflate
Validated permessage-deflate response parameters. Absence of a window parameter preserves the protocol default.
-
class
WebSocketDeflateNegotiation
The accepted offer and response together with effective compression settings for each direction.
-
class
WebSocketDeflateOffer
One validated permessage-deflate offer, preserving omitted versus valueless client window parameters.
-
class
WebSocketExtension
An extension token and its ordered parameters from Sec-WebSocket-Extensions.
-
class
WebSocketExtensionParameter
A normalized WebSocket extension parameter with an optional value and quoted-string source flag.
-
class
WebSocketFrameDecoder
A serial incremental frame parser that validates masking, fragmentation, control frames, and limits. Compression flag acceptance does not itself inflate message data.
-
class
WebSocketFrameEncoder
A serial in-memory frame encoder with explicit begin/write/finish. Client frames receive fresh masking keys; it does not perform compression or transport I/O.
-
enum
WebSocketFrameEvent
Parsed frame boundaries, data chunks, complete control payloads, and terminal input state.
-
class
WebSocketFrameException
A framing, message, or UTF-8 failure with the appropriate WebSocket close code and optional byte offset.
-
class
WebSocketFrameHead
Frame opcode, nonnegative payload length, FIN flag, and compressed-message flag.
-
class
WebSocketFrameLimits
Nonnegative per-frame and per-message byte limits with a positive emitted chunk size.
- class WebSocketFrameLimitsBuilder
-
class
WebSocketHandshake
A validated HTTP/1 WebSocket upgrade request, nonce key, offered subprotocols, and extensions. Response validation remains tied to this exact request.
-
class
WebSocketHandshakeException
A handshake failure with its portable kind and optional field context.
-
enum
WebSocketHandshakeFailureKind
Distinguishes malformed handshakes from an otherwise valid unsupported request version.
-
enum
WebSocketMessageType
The logical type of a complete or fragmented data message.
-
class
WebSocketMessageValidator
Validates the final message byte stream against a size limit and, for text, incremental UTF-8 validity. Feed decompressed bytes when compression is used.
-
class
WebSocketNegotiation
The accepted optional subprotocol and permessage-deflate parameters.
-
enum
WebSocketOpcode
The data or control operation encoded by a WebSocket frame.
-
class
WebSocketServerResponse
A generated server upgrade response and the negotiation already checked while constructing it.
-
enum
WebSocketWindowBits
The client_max_window_bits offer form: omitted, valueless permission, or an explicit limit.
- function copy
- function copyFields
-
function
evaluateHttpPreconditions
Evaluates validators in HTTP precedence order after normal request checks. The reference is explicit for obsolete HTTP dates. Invalid tag syntax throws; unusable dates are ignored.
-
function
findAll
Returns all fields whose names match under ASCII case val folding, preserving order without combining their values.
-
function
hasName
Compares this field's name using ASCII case folding.
-
function
http2UpgradeAccepted
Returns false for a non-101 response; validates a 101 response as a genuine HTTP/1.1 h2c acceptance or throws.
-
function
http2UpgradeResponse
Constructs the HTTP/1.1 101 response accepting h2c.
-
function
httpConnectAccepted
Returns whether CONNECT received a 2xx status.
-
function
httpConnectRequest
Builds an authority-form CONNECT request for HTTP/1 or HTTP/2 using the URL's effective port.
-
function
httpExpectsContinue
Tests parsed Expect fields for the 100-continue expectation.
-
function
httpFields
Collects ordered ordinary fields without combining duplicates.
-
function
httpProxyRequest
Builds an HTTP/1 absolute-form request from an HTTP URL, deriving Host and rejecting conflicting caller-supplied Host fields.
-
function
httpResponseAllowsContent
Checks response content semantics for the exact request method and status, including HEAD, CONNECT, and bodyless statuses.
-
function
isHttpToken
Returns whether all supplied bytes or scalars form a nonempty HTTP token.
-
function
multipartLimits
Configures one complete value; execution remains explicit.
-
function
parseHttpContentLength
Parses Content-Length fields, rejecting malformed, overflowing, or conflicting values; absent fields return None.
-
function
parseHttpExpectations
Parses every Expect field once, retaining both recognized and unknown expectation facts.
-
function
parseHttpTokenFields
Parses the selected fields as comma-separated HTTP tokens in field order.
-
function
prepareHttp2Upgrade
Adds h2c Upgrade and unpadded HTTP2-Settings fields to a regular HTTP/1.1 request; conflicting fields and CONNECT are rejected.
-
function
readHttp2UpgradeSettings
Validates h2c request negotiation fields and decodes the unique HTTP2-Settings payload.
-
function
selectHttpAlpn
Maps negotiated h2 or http/1.1 to an allowed protocol. Absent ALPN uses HTTP/1 only when fallback is explicitly enabled.
-
function
validate
Validates this field's name token and permitted value bytes, throwing on invalid syntax.