Module Spindle_http

HTTP as both ends speak it: what a server and a client share, and what an application names -- statuses, methods, fields and the values they carry, the messages spoken after HTTP, and what a line is logged with. Each module's .mli is its reference.

Messages

module Status : sig ... end

The statuses a handler may answer with.

module Meth : sig ... end

Request methods: every one RFC 9110 §9 defines, and PATCH (RFC 5789); `Other m is any other, spelled as it came.

module Version : sig ... end

The HTTP/1 versions a message is spoken in: what a request says it speaks (Spindle.Request.version), and what a test asks to be called with.

module Field : sig ... end

The field grammar every message shares: RFC 9110's tokens, a field line split and checked, a list field's elements, and a field found by name.

Values a field carries

module Media_type : sig ... end

A media type, as Content-Type holds one (RFC 9110 §8.3.1): a type, a subtype and parameters.

module Accept : sig ... end

Content negotiation, as RFC 9110 §12 writes it: what a request accepts, each with its weight, and choosing among what a route can answer.

module Auth : sig ... end

Authentication, as RFC 9110 §11 writes it: the credentials a request carries in Authorization or Proxy-Authorization, and the challenges a 401 or a 407 names in WWW-Authenticate or Proxy-Authenticate.

module Jwk : sig ... end

Public keys as RFC 7517 writes them, of the kinds a signature is checked with here: RSA (RFC 7518 §6.3) of 2048 bits or more, which RFC 7518 §3.3 requires of RS256; EC on P-256 (RFC 7518 §6.2); and OKP on Ed25519 (RFC 8037 §2). A private member a key carries is not read.

module Jws : sig ... end

JSON Web Signatures in the compact serialization (RFC 7515 §7.1): a header, a payload and a signature, checked against public keys (Jwk) by RS256, ES256 or EdDSA. No other algorithm is checked: "none" signs nothing, and an HMAC's key is a secret both ends hold, which a public key set never is.

module Cache_control : sig ... end

Cache-Control, as RFC 9111 §5.2 writes it: directives, each with an argument or none.

module Date : sig ... end

An HTTP-date read, as RFC 9110 §5.6.7 has a recipient read one: the IMF-fixdate a sender writes (to_string), and the two obsolete forms a recipient must still accept.

module Etag : sig ... end

Entity tags, as RFC 9110 §8.8.3 writes them, and the two ways §8.8.3.2 compares them.

module Range : sig ... end

Byte ranges, as RFC 9110 §14 writes them: a request's Range, and the Content-Range of an answer to one.

module Forwarded : sig ... end

Forwarded, as RFC 7239 writes it: each proxy a request passed through, what it saw -- who asked it, on which of its interfaces, for which host, over which protocol.

module Structured : sig ... end

Structured Fields, as RFC 9651 defines them for the fields built on it: an item, a list or a dictionary, each value with parameters.

Bodies

module Urlencoded : sig ... end

application/x-www-form-urlencoded, as the WHATWG URL standard reads and writes it: what a browser posts from a form with no file in it.

module Multipart : sig ... end

multipart/form-data, as RFC 7578 writes it over RFC 2046's boundaries: what a browser posts from a form with a file in it, read a part at a time as it arrives.

module Event_stream : sig ... end

Server-Sent Events, as the HTML standard writes and reads an event stream (text/event-stream): what a server sends and what a client reads it as, in one module, so both ends of a stream have one account of where an event ends.

After HTTP

module Connection : sig ... end

A connection once a protocol spoken after HTTP has it: a server's after it answered 101 Switching Protocols, a client's after its handshake.

module Websocket : module type of struct include Websocket end with module Private := Websocket.Private

WebSockets, served and called, in one model: a protocol says what each side sends, and each end holds a socket typed from its own side.

Running

module Instant : sig ... end

Instants, as a Ptime.t, and the waits between them, as an Mtime.Span.t: what a clock is read into, the one place a wait until an instant is worked out, and a sleep for code no Eio loop runs.

module Log : sig ... end

What a line is made of, on either end of a call: the framework's source, a line's structured fields, and the request a fiber runs for.

module Trace : sig ... end

Spans: what a request did, and how long each part of it took, recorded under the W3C trace Log already carries, so a server, the calls it makes and the statements it runs are one trace.

module Local : sig ... end

What belongs to the domain a fiber runs on.

Spindle's own

module Private : sig ... end

How Spindle's server and client read and write the wire: a head read off a connection, where a body ends, a message written, and a WebSocket run over a connection. They are reached here because both ends are built on them, and are not covered by the library's version -- any may change in any release. An application names none of them.