package h2

  1. Overview
  2. Docs
A high-performance, memory-efficient, and scalable HTTP/2 library for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

h2-0.13.0.tbz
sha256=0d89b6f178175294e7a207223be81d5b83fc31b97549bec34f0432a3b2a8070f
sha512=a442cb80f40fd179211e9ab7b4b748a4d2f7ad6ece75301d74a5363c08cd05a70b94ae90ff6fc6b95e8284c57c14cc17cbe7ade5dbf19b21b56207c6f984faf4

doc/h2/H2/Response/index.html

Module H2.ResponseSource

Response

A server-generated message to a Request.t.

Sourcetype t = {
  1. status : Status.t;
  2. headers : Headers.t;
}
Sourceval create : ?headers:Headers.t -> Status.t -> t

create ?headers status creates an HTTP response with the given parameters. Unlike the Response type in httpun, h2 does not define a way for responses to carry reason phrases or protocol version.

See RFC7540§8.1.2.4 for more details.

Sourceval body_length : request_method:Method.standard -> t -> [ `Error of [ `Bad_request ] | `Fixed of int64 | `Unknown ]

body_length ~request_method t is the length of the message body accompanying t assuming it is a response to a request whose method was request_method.

See RFC7230§3.3.3 for more details.

Sourceval pp_hum : Format.formatter -> t -> unit