Head.ResponseA response's head, as a client reads it.
Two readers over one field grammar rather than one with flags, because a client and a server are owed different things by the same bytes: RFC 9112 §5.2 has a user agent join an obsolete fold that a server must refuse, and a response may end where its connection does.
type t = {version : version;HTTP/1.1 for any later HTTP/1 minor version, as for a request
status : Status.t;reason : string;as sent, and nothing should act on it
*)headers : (string * string) list;in the order sent, names as sent, values trimmed, a folded line joined onto the field before it
*)}Why a response's head was not read: in the shape a request's is, since both are a connection's peer and what it sent.
val error_to_string : error -> stringThe next head.
A status line is a version, a space, a code of three digits from 100 to 599, and the reason after a space; the space may be missing, since nothing turns on the reason. Another major version than HTTP/1 is malformed. An empty line before the status line is not skipped, as a server skips one before a request: to a client it is the last response ending somewhere its framing did not say. A field is what Field.parse reads, but for an obsolete fold, joined to the field before it as RFC 9112 §5.2 has a user agent join one; a bare CR and a head past max bytes are malformed, and a line may end in a bare LF.
A 1xx is a head of its own, with no body, and the final response follows it.
val keep_alive : t -> boolWhether the server will keep the connection, on the same terms as Request.keep_alive. Whether the body leaves it where the next response begins is Framing's: a body delimited by the connection closing ends with it.