From 0273290cb1f001e80954baf182d30d53c264bfe1 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Thu, 21 Nov 2024 21:11:12 +0000 Subject: [PATCH] Update cohttp doc to 6.0.0. --- .../Cohttp_async/Body/Private/index.html | 2 +- cohttp-async/Cohttp_async/Body/index.html | 4 +-- .../Cohttp_async/Client/Connection/index.html | 4 +-- cohttp-async/Cohttp_async/Client/index.html | 2 +- cohttp-async/Cohttp_async/Io/IO/index.html | 2 +- .../Cohttp_async/Io/Request/index.html | 4 +-- .../Cohttp_async/Io/Response/index.html | 4 +-- cohttp-async/Cohttp_async/Io/index.html | 2 +- .../Cohttp_async/Server/Expert/index.html | 2 +- cohttp-async/Cohttp_async/Server/index.html | 8 ++---- cohttp-async/Cohttp_async/index.html | 2 +- cohttp-async/index.html | 2 +- cohttp-bench/index.html | 2 +- cohttp-curl-async/index.html | 2 +- .../Cohttp_curl_lwt/Context/index.html | 2 +- .../Cohttp_curl_lwt/Error/index.html | 2 ++ .../Cohttp_curl_lwt/Request/Expert/index.html | 2 +- .../Cohttp_curl_lwt/Request/index.html | 2 +- .../Response/Expert/index.html | 2 +- .../Cohttp_curl_lwt/Response/index.html | 2 +- .../Cohttp_curl_lwt/Sink/index.html | 2 +- .../Cohttp_curl_lwt/Source/index.html | 2 +- cohttp-curl-lwt/Cohttp_curl_lwt/index.html | 2 +- cohttp-curl-lwt/index.html | 2 +- .../Cohttp_curl/Private/Error/index.html | 2 ++ .../Cohttp_curl/Private/Request/index.html | 2 +- .../Cohttp_curl/Private/Sink/index.html | 2 +- .../Cohttp_curl/Private/Source/index.html | 2 +- cohttp-curl/Cohttp_curl/Private/index.html | 2 +- cohttp-curl/Cohttp_curl/index.html | 2 +- cohttp-curl/index.html | 2 +- .../Cohttp_eio/Body/String_source/index.html | 2 +- cohttp-eio/Cohttp_eio/Body/index.html | 2 +- cohttp-eio/Cohttp_eio/Client/index.html | 6 ++-- cohttp-eio/Cohttp_eio/Private/IO/index.html | 2 +- cohttp-eio/Cohttp_eio/Private/index.html | 2 +- cohttp-eio/Cohttp_eio/Server/IO/index.html | 2 +- cohttp-eio/Cohttp_eio/Server/index.html | 19 ++++++------- cohttp-eio/Cohttp_eio/index.html | 2 +- cohttp-eio/index.html | 2 +- .../Cohttp_lwt_jsoo/Client/index.html | 4 +-- .../Cohttp_lwt_jsoo/Client_sync/index.html | 4 +-- .../{argument-1-P => argument-1-_}/index.html | 2 +- .../Make_client_async/index.html | 4 +-- .../{argument-1-P => argument-1-_}/index.html | 2 +- .../Make_client_sync/index.html | 4 +-- cohttp-lwt-jsoo/Cohttp_lwt_jsoo/index.html | 4 +-- .../module-type-Params/index.html | 2 +- cohttp-lwt-jsoo/index.html | 2 +- .../Cohttp_lwt_unix/Client/index.html | 4 +-- .../Connection/Net/IO/index.html | 2 +- .../Cohttp_lwt_unix/Connection/Net/index.html | 2 +- .../Cohttp_lwt_unix/Connection/index.html | 2 +- .../Connection_cache/index.html | 2 +- .../Cohttp_lwt_unix/Debug/index.html | 2 +- cohttp-lwt-unix/Cohttp_lwt_unix/IO/index.html | 2 +- .../Cohttp_lwt_unix/Net/IO/index.html | 2 +- .../Cohttp_lwt_unix/Net/index.html | 4 +-- .../Cohttp_lwt_unix/Private/IO/index.html | 2 +- .../Private/Input_channel/index.html | 2 +- .../Cohttp_lwt_unix/Private/index.html | 2 +- .../Cohttp_lwt_unix/Request/IO/index.html | 2 +- .../Cohttp_lwt_unix/Request/index.html | 4 +-- .../Cohttp_lwt_unix/Response/IO/index.html | 2 +- .../Cohttp_lwt_unix/Response/index.html | 5 ++-- .../Cohttp_lwt_unix/Server/IO/index.html | 2 +- .../Cohttp_lwt_unix/Server/index.html | 13 ++++----- cohttp-lwt-unix/Cohttp_lwt_unix/index.html | 2 +- cohttp-lwt-unix/index.html | 2 +- cohttp-lwt/Cohttp_lwt/Body/index.html | 2 +- .../argument-1-Connection/Net/IO/index.html | 2 +- .../Make/argument-1-Connection/Net/index.html | 2 +- .../Make/argument-1-Connection/index.html | 4 +-- cohttp-lwt/Cohttp_lwt/Client/Make/index.html | 4 +-- cohttp-lwt/Cohttp_lwt/Client/index.html | 2 +- .../Make/argument-1-Net/IO/index.html | 2 +- .../Connection/Make/argument-1-Net/index.html | 2 +- .../Cohttp_lwt/Connection/Make/index.html | 4 +-- cohttp-lwt/Cohttp_lwt/Connection/index.html | 2 +- .../argument-1-Connection/Net/IO/index.html | 2 +- .../Make/argument-1-Connection/Net/index.html | 2 +- .../Make/argument-1-Connection/index.html | 4 +-- .../Make/argument-2-Sleep/index.html | 2 +- .../Connection_cache/Make/index.html | 2 +- .../argument-1-Connection/Net/IO/index.html | 2 +- .../argument-1-Connection/Net/index.html | 2 +- .../argument-1-Connection/index.html | 4 +-- .../Connection_cache/Make_no_cache/index.html | 2 +- .../Cohttp_lwt/Connection_cache/index.html | 2 +- .../Make_client/argument-1-IO/index.html | 2 +- .../Make_client/argument-2-Net/index.html | 2 +- cohttp-lwt/Cohttp_lwt/Make_client/index.html | 2 +- .../Cohttp_lwt/Private/Bytebuffer/index.html | 2 +- .../Cohttp_lwt/Private/String_io/index.html | 2 +- cohttp-lwt/Cohttp_lwt/Private/index.html | 2 +- cohttp-lwt/Cohttp_lwt/S/index.html | 4 +-- .../S/module-type-Client/index.html | 4 +-- .../module-type-Connection/Net/IO/index.html | 2 +- .../S/module-type-Connection/Net/index.html | 2 +- .../S/module-type-Connection/index.html | 4 +-- .../S/module-type-Connection_cache/index.html | 2 +- .../Cohttp_lwt/S/module-type-IO/index.html | 2 +- .../S/module-type-Net/IO/index.html | 2 +- .../Cohttp_lwt/S/module-type-Net/index.html | 2 +- .../S/module-type-Server/IO/index.html | 2 +- .../S/module-type-Server/index.html | 13 +++++---- .../Cohttp_lwt/S/module-type-Sleep/index.html | 2 +- .../Server/Make/argument-1-IO/index.html | 2 +- cohttp-lwt/Cohttp_lwt/Server/Make/index.html | 13 +++++---- cohttp-lwt/Cohttp_lwt/Server/index.html | 2 +- cohttp-lwt/Cohttp_lwt/index.html | 2 +- cohttp-lwt/index.html | 2 +- .../Client/Make/Connection/Net/IO/index.html | 2 +- .../Client/Make/Connection/Net/index.html | 2 +- .../Client/Make/Connection/index.html | 4 +-- .../Cohttp_mirage/Client/Make/index.html | 4 +-- cohttp-mirage/Cohttp_mirage/Client/index.html | 4 +-- cohttp-mirage/Cohttp_mirage/IO/index.html | 2 +- .../Cohttp_mirage/Server/Flow/IO/index.html | 2 +- .../Cohttp_mirage/Server/Flow/index.html | 13 ++++----- .../Cohttp_mirage/Server/Make/IO/index.html | 2 +- .../Cohttp_mirage/Server/Make/index.html | 13 ++++----- cohttp-mirage/Cohttp_mirage/Server/index.html | 2 +- .../Server/module-type-S/IO/index.html | 2 +- .../Server/module-type-S/index.html | 13 ++++----- .../Static/HTTP/argument-2-S/IO/index.html | 2 +- .../Static/HTTP/argument-2-S/index.html | 13 ++++----- .../Cohttp_mirage/Static/HTTP/index.html | 2 +- cohttp-mirage/Cohttp_mirage/Static/index.html | 2 +- cohttp-mirage/Cohttp_mirage/index.html | 2 +- cohttp-mirage/index.html | 2 +- .../Body/Encoding/index.html | 2 +- .../Body/Substring/index.html | 2 +- .../Cohttp_server_lwt_unix/Body/index.html | 2 +- .../Cohttp_server_lwt_unix/Context/index.html | 2 +- .../Cohttp_server_lwt_unix/index.html | 25 +++++++++++++++-- cohttp-server-lwt-unix/index.html | 2 +- cohttp-top/Cohttp_top/index.html | 2 +- cohttp-top/index.html | 2 +- cohttp/Cohttp/Accept/index.html | 2 +- cohttp/Cohttp/Auth/index.html | 2 +- cohttp/Cohttp/Body/index.html | 2 +- cohttp/Cohttp/Code/index.html | 2 +- cohttp/Cohttp/Conf/index.html | 2 +- cohttp/Cohttp/Connection/index.html | 2 +- cohttp/Cohttp/Cookie/Cookie_hdr/index.html | 2 +- .../Cohttp/Cookie/Set_cookie_hdr/index.html | 2 +- cohttp/Cohttp/Cookie/index.html | 2 +- .../Client/Make/argument-1-Base/index.html | 2 +- .../Client/Make/argument-2-IO/index.html | 2 +- cohttp/Cohttp/Generic/Client/Make/index.html | 2 +- cohttp/Cohttp/Generic/Client/index.html | 2 +- .../Client/module-type-BASE/index.html | 2 +- .../Generic/Client/module-type-S/index.html | 2 +- cohttp/Cohttp/Generic/Server/index.html | 2 +- .../Server/module-type-S/IO/index.html | 2 +- .../Generic/Server/module-type-S/index.html | 10 +++---- cohttp/Cohttp/Generic/index.html | 2 +- cohttp/Cohttp/Header/Private/index.html | 2 +- cohttp/Cohttp/Header/index.html | 2 +- cohttp/Cohttp/Link/Arc/index.html | 2 +- cohttp/Cohttp/Link/Charset/index.html | 2 +- cohttp/Cohttp/Link/Ext/index.html | 2 +- cohttp/Cohttp/Link/Language/index.html | 2 +- cohttp/Cohttp/Link/Rel/index.html | 2 +- cohttp/Cohttp/Link/index.html | 2 +- cohttp/Cohttp/Path/index.html | 2 +- .../Header_io/Make/argument-1-IO/index.html | 2 +- .../Cohttp/Private/Header_io/Make/index.html | 2 +- cohttp/Cohttp/Private/Header_io/index.html | 2 +- cohttp/Cohttp/Private/String_io/M/index.html | 2 +- cohttp/Cohttp/Private/String_io/index.html | 2 +- .../Transfer_io/Make/argument-1-IO/index.html | 2 +- .../Private/Transfer_io/Make/index.html | 2 +- cohttp/Cohttp/Private/Transfer_io/index.html | 2 +- cohttp/Cohttp/Private/index.html | 2 +- .../Request/Make/argument-1-IO/index.html | 2 +- cohttp/Cohttp/Request/Make/index.html | 2 +- .../Private/Make/argument-1-IO/index.html | 2 +- cohttp/Cohttp/Request/Private/Make/index.html | 2 +- cohttp/Cohttp/Request/Private/index.html | 2 +- cohttp/Cohttp/Request/index.html | 2 +- .../Response/Make/argument-1-IO/index.html | 2 +- cohttp/Cohttp/Response/Make/index.html | 2 +- .../Private/Make/argument-1-IO/index.html | 2 +- .../Cohttp/Response/Private/Make/index.html | 2 +- cohttp/Cohttp/Response/Private/index.html | 2 +- cohttp/Cohttp/Response/index.html | 3 +- cohttp/Cohttp/S/index.html | 2 +- cohttp/Cohttp/S/module-type-Body/index.html | 2 +- .../S/module-type-Http_io/IO/index.html | 2 +- .../Cohttp/S/module-type-Http_io/index.html | 2 +- cohttp/Cohttp/S/module-type-IO/index.html | 2 +- .../Cohttp/S/module-type-Request/index.html | 2 +- .../Cohttp/S/module-type-Response/index.html | 3 +- cohttp/Cohttp/Transfer/index.html | 2 +- cohttp/Cohttp/index.html | 2 +- cohttp/index.html | 2 +- http/Http/Header/Private/index.html | 2 +- http/Http/Header/index.html | 2 +- http/Http/Method/index.html | 2 +- http/Http/Private/Parser/index.html | 2 +- http/Http/Private/index.html | 2 +- http/Http/Request/index.html | 5 ++-- http/Http/Response/index.html | 5 ++-- http/Http/Status/index.html | 2 +- http/Http/Transfer/Private/index.html | 2 +- http/Http/Transfer/index.html | 2 +- http/Http/Version/index.html | 2 +- http/Http/index.html | 2 +- .../Bytebuffer/Make/argument-1-IO/index.html | 2 +- .../Make/argument-2-Refill/index.html | 2 +- .../Bytebuffer/Make/index.html | 2 +- http/Http_bytebuffer/Bytebuffer/index.html | 2 +- http/Http_bytebuffer/index.html | 2 +- http/index.html | 2 +- index.html | 28 +++++++++---------- odoc.support/odoc.css | 2 +- 218 files changed, 331 insertions(+), 323 deletions(-) create mode 100644 cohttp-curl-lwt/Cohttp_curl_lwt/Error/index.html create mode 100644 cohttp-curl/Cohttp_curl/Private/Error/index.html rename cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_async/{argument-1-P => argument-1-_}/index.html (85%) rename cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_sync/{argument-1-P => argument-1-_}/index.html (85%) diff --git a/cohttp-async/Cohttp_async/Body/Private/index.html b/cohttp-async/Cohttp_async/Body/Private/index.html index 25a40ee4d..fb7c13bef 100644 --- a/cohttp-async/Cohttp_async/Body/Private/index.html +++ b/cohttp-async/Cohttp_async/Body/Private/index.html @@ -1,5 +1,5 @@ -Private (cohttp-async.Cohttp_async.Body.Private)

Module Body.Private

val write_body : +Private (cohttp-async.Cohttp_async.Body.Private)

Module Body.Private

val write_body : ('a -> Base.string -> Base.unit Async_kernel.Deferred.t) -> t -> 'a -> diff --git a/cohttp-async/Cohttp_async/Body/index.html b/cohttp-async/Cohttp_async/Body/index.html index 028bb5002..9ff7c19a4 100644 --- a/cohttp-async/Cohttp_async/Body/index.html +++ b/cohttp-async/Cohttp_async/Body/index.html @@ -1,9 +1,9 @@ -Body (cohttp-async.Cohttp_async.Body)

Module Cohttp_async.Body

type t = [
  1. | Cohttp.Body.t
  2. | `Pipe of Base.string Async_kernel.Pipe.Reader.t
]
val sexp_of_t : t -> Sexplib0.Sexp.t
include Cohttp.S.Body with type t := t
val empty : t
val of_string : string -> t
val of_string_list : string list -> t
val of_form : ?scheme:string -> (string * string list) list -> t
val transfer_encoding : t -> Cohttp.Transfer.encoding
val drain : t -> Base.unit Async_kernel.Deferred.t
val is_empty : t -> Base.bool Async_kernel.Deferred.t
val to_string : t -> Base.string Async_kernel.Deferred.t
val to_string_list : t -> Base.string Base.list Async_kernel.Deferred.t
val to_pipe : t -> Base.string Async_kernel.Pipe.Reader.t
val of_pipe : Base.string Async_kernel.Pipe.Reader.t -> t
val map : t -> f:(Base.string -> Base.string) -> t
val as_pipe : +Body (cohttp-async.Cohttp_async.Body)

Module Cohttp_async.Body

type t = [
  1. | Cohttp.Body.t
  2. | `Pipe of Base.string Async_kernel.Pipe.Reader.t
]
val sexp_of_t : t -> Sexplib0.Sexp.t
include Cohttp.S.Body with type t := t
val empty : t
val of_string : string -> t
val of_string_list : string list -> t
val of_form : ?scheme:string -> (string * string list) list -> t
val transfer_encoding : t -> Cohttp.Transfer.encoding
val to_string : t -> Base.string Async_kernel.Deferred.t
val to_string_list : t -> Base.string Base.list Async_kernel.Deferred.t
val to_pipe : t -> Base.string Async_kernel.Pipe.Reader.t
val of_pipe : Base.string Async_kernel.Pipe.Reader.t -> t
val map : t -> f:(Base.string -> Base.string) -> t
val as_pipe : t -> f: (Base.string Async_kernel.Pipe.Reader.t -> Base.string Async_kernel.Pipe.Reader.t) -> t
val to_form : t -> - (Base.string * Base.string Base.list) Base.list Async_kernel.Deferred.t
module Private : sig ... end
+ (Base.string * Base.string Base.list) Base.list Async_kernel.Deferred.t
val is_empty : t -> [ `True | `False | `Unknown ]
module Private : sig ... end
diff --git a/cohttp-async/Cohttp_async/Client/Connection/index.html b/cohttp-async/Cohttp_async/Client/Connection/index.html index b57bcc82c..84f774a1c 100644 --- a/cohttp-async/Cohttp_async/Client/Connection/index.html +++ b/cohttp-async/Cohttp_async/Client/Connection/index.html @@ -1,9 +1,9 @@ -Connection (cohttp-async.Cohttp_async.Client.Connection)

Module Client.Connection

type t
val connect : +Connection (cohttp-async.Cohttp_async.Client.Connection)

Module Client.Connection

type t
val connect : ?interrupt:unit Async_kernel.Deferred.t -> ?ssl_config:Conduit_async.V2.Ssl.Config.t -> Uri.t -> - t Async_kernel.Deferred.t
val close : t -> unit Async_kernel.Deferred.t
val is_closed : t -> bool
val request : + t Async_kernel.Deferred.t
val close : t -> unit Async_kernel.Deferred.t
val close_finished : t -> unit Async_kernel.Deferred.t
val is_closed : t -> bool
val request : ?body:Body.t -> t -> Http.Request.t -> diff --git a/cohttp-async/Cohttp_async/Client/index.html b/cohttp-async/Cohttp_async/Client/index.html index 3641e2e8b..48d6c5224 100644 --- a/cohttp-async/Cohttp_async/Client/index.html +++ b/cohttp-async/Cohttp_async/Client/index.html @@ -1,5 +1,5 @@ -Client (cohttp-async.Cohttp_async.Client)

Module Cohttp_async.Client

val request : +Client (cohttp-async.Cohttp_async.Client)

Module Cohttp_async.Client

val request : ?interrupt:unit Async_kernel.Deferred.t -> ?ssl_config:Conduit_async.V2.Ssl.Config.t -> ?uri:Uri.t -> diff --git a/cohttp-async/Cohttp_async/Io/IO/index.html b/cohttp-async/Cohttp_async/Io/IO/index.html index 91ecb9b42..f0b98efa2 100644 --- a/cohttp-async/Cohttp_async/Io/IO/index.html +++ b/cohttp-async/Cohttp_async/Io/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-async.Cohttp_async.Io.IO)

Module Io.IO

type 'a t = 'a Async_kernel.Deferred.t

'a t represents a blocking monad state

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

a >>= b will pass the result of a to the b function. This is a monadic bind.

val return : 'a -> 'a t

return a will construct a constant IO value.

type ic

ic represents an input channel

type oc = Async_unix.Writer.t

oc represents an output channel

type conn

conn represents the underlying network flow

val refill : ic -> [ `Ok | `Eof ] t
val with_input_buffer : +IO (cohttp-async.Cohttp_async.Io.IO)

Module Io.IO

type 'a t = 'a Async_kernel.Deferred.t

'a t represents a blocking monad state

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

a >>= b will pass the result of a to the b function. This is a monadic bind.

val return : 'a -> 'a t

return a will construct a constant IO value.

type ic

ic represents an input channel

type oc = Async_unix.Writer.t

oc represents an output channel

type conn

conn represents the underlying network flow

val refill : ic -> [ `Ok | `Eof ] t
val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
val read_line : ic -> string option t

read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

val read : ic -> int -> string t

read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

val write : oc -> string -> unit t

write oc s will block until the complete s string is written to the output channel oc.

val flush : oc -> unit t

flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

diff --git a/cohttp-async/Cohttp_async/Io/Request/index.html b/cohttp-async/Cohttp_async/Io/Request/index.html index 997c61f55..0b43f0971 100644 --- a/cohttp-async/Cohttp_async/Io/Request/index.html +++ b/cohttp-async/Cohttp_async/Io/Request/index.html @@ -1,6 +1,6 @@ -Request (cohttp-async.Cohttp_async.Io.Request)

Module Io.Request

type reader
type writer
val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of Http.Request.t ] IO.t
val make_body_writer : ?flush:bool -> Http.Request.t -> IO.oc -> writer
val make_body_reader : Http.Request.t -> IO.ic -> reader
val read_body_chunk : reader -> Cohttp.Transfer.chunk IO.t
val write_header : Http.Request.t -> IO.oc -> unit IO.t
val write_body : writer -> string -> unit IO.t
val write : - ?flush:bool -> +Request (cohttp-async.Cohttp_async.Io.Request)

Module Io.Request

type reader
type writer
val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of Http.Request.t ] IO.t
val make_body_writer : flush:bool -> Http.Request.t -> IO.oc -> writer
val make_body_reader : Http.Request.t -> IO.ic -> reader
val read_body_chunk : reader -> Cohttp.Transfer.chunk IO.t
val write_header : Http.Request.t -> IO.oc -> unit IO.t
val write_body : writer -> string -> unit IO.t
val write : + flush:bool -> (writer -> unit IO.t) -> Http.Request.t -> IO.oc -> diff --git a/cohttp-async/Cohttp_async/Io/Response/index.html b/cohttp-async/Cohttp_async/Io/Response/index.html index a9f314b55..b36eb41de 100644 --- a/cohttp-async/Cohttp_async/Io/Response/index.html +++ b/cohttp-async/Cohttp_async/Io/Response/index.html @@ -1,6 +1,6 @@ -Response (cohttp-async.Cohttp_async.Io.Response)

Module Io.Response

type reader
type writer
val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of Http.Response.t ] IO.t
val make_body_writer : ?flush:bool -> Http.Response.t -> IO.oc -> writer
val make_body_reader : Http.Response.t -> IO.ic -> reader
val read_body_chunk : reader -> Cohttp.Transfer.chunk IO.t
val write_header : Http.Response.t -> IO.oc -> unit IO.t
val write_body : writer -> string -> unit IO.t
val write : - ?flush:bool -> +Response (cohttp-async.Cohttp_async.Io.Response)

Module Io.Response

type reader
type writer
val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of Http.Response.t ] IO.t
val make_body_writer : flush:bool -> Http.Response.t -> IO.oc -> writer
val make_body_reader : Http.Response.t -> IO.ic -> reader
val read_body_chunk : reader -> Cohttp.Transfer.chunk IO.t
val write_header : Http.Response.t -> IO.oc -> unit IO.t
val write_body : writer -> string -> unit IO.t
val write : + flush:bool -> (writer -> unit IO.t) -> Http.Response.t -> IO.oc -> diff --git a/cohttp-async/Cohttp_async/Io/index.html b/cohttp-async/Cohttp_async/Io/index.html index 3592178a6..02ae67284 100644 --- a/cohttp-async/Cohttp_async/Io/index.html +++ b/cohttp-async/Cohttp_async/Io/index.html @@ -1,5 +1,5 @@ -Io (cohttp-async.Cohttp_async.Io)

Module Cohttp_async.Io

  • deprecated This module is not for public consumption
module IO : +Io (cohttp-async.Cohttp_async.Io)

Module Cohttp_async.Io

  • deprecated This module is not for public consumption
module IO : Cohttp.S.IO with type 'a t = 'a Async_kernel.Deferred.t and type ic = Cohttp_async__.Input_channel.t diff --git a/cohttp-async/Cohttp_async/Server/Expert/index.html b/cohttp-async/Cohttp_async/Server/Expert/index.html index 065ce4911..60d103b18 100644 --- a/cohttp-async/Cohttp_async/Server/Expert/index.html +++ b/cohttp-async/Cohttp_async/Server/Expert/index.html @@ -1,5 +1,5 @@ -Expert (cohttp-async.Cohttp_async.Server.Expert)

Module Server.Expert

val create : +Expert (cohttp-async.Cohttp_async.Server.Expert)

Module Server.Expert

val create : (body:Body.t -> 'addr -> Http.Request.t -> response Async_kernel.Deferred.t) -> 'addr -> Async_unix.Reader.t -> diff --git a/cohttp-async/Cohttp_async/Server/index.html b/cohttp-async/Cohttp_async/Server/index.html index bf61396e8..1c3089f56 100644 --- a/cohttp-async/Cohttp_async/Server/index.html +++ b/cohttp-async/Cohttp_async/Server/index.html @@ -1,10 +1,9 @@ -Server (cohttp-async.Cohttp_async.Server)

Module Cohttp_async.Server

type ('address, 'listening_on) t constraint 'address = [< Async_unix.Socket.Address.t ]
val sexp_of_t : +Server (cohttp-async.Cohttp_async.Server)

Module Cohttp_async.Server

type ('address, 'listening_on) t constraint 'address = [< Async_unix.Socket.Address.t ]
val sexp_of_t : ('address -> Sexplib0.Sexp.t) -> ('listening_on -> Sexplib0.Sexp.t) -> ('address, 'listening_on) t -> Sexplib0.Sexp.t
val close : (_, _) t -> unit Async_kernel.Deferred.t
val close_finished : (_, _) t -> unit Async_kernel.Deferred.t
val is_closed : (_, _) t -> bool
val listening_on : (_, 'listening_on) t -> 'listening_on
val num_connections : (_, _) t -> int
type response = Http.Response.t * Body.t
val sexp_of_response : response -> Sexplib0.Sexp.t
type 'r respond_t = - ?flush:bool -> ?headers:Http.Header.t -> ?body:Body.t -> Http.Status.t -> @@ -12,13 +11,11 @@ Http.Response.t * (Async_unix.Reader.t -> Async_unix.Writer.t -> - unit Async_kernel.Deferred.t)
  • | `Response of response
  • ]

    A request handler can respond in two ways:

    • Using `Response, with a Http.Response.t and a Body.t.
    • Using `Expert, with a Http.Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying Async_unix.Reader.t and Async_unix.Writer.t, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unitAsync_kernel.Deferred.t is resolved. The connection can be closed by closing the Async_unix.Reader.t.
    val respond : response respond_t
    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve a URI and a docroot into a concrete local filename.

    • deprecated Please use Cohttp.Path.resolve_local_file.
    val respond_with_pipe : - ?flush:bool -> + unit Async_kernel.Deferred.t)
  • | `Response of response
  • ]

    A request handler can respond in two ways:

    • Using `Response, with a Http.Response.t and a Body.t.
    • Using `Expert, with a Http.Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying Async_unix.Reader.t and Async_unix.Writer.t, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unit Async_kernel.Deferred.t is resolved. The connection can be closed by closing the Async_unix.Reader.t.
    val respond : response respond_t
    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve a URI and a docroot into a concrete local filename.

    • deprecated Please use Cohttp.Path.resolve_local_file.
    val respond_with_pipe : ?headers:Http.Header.t -> ?code:Http.Status.t -> string Async_kernel.Pipe.Reader.t -> response Async_kernel.Deferred.t

    Respond with a string Pipe that provides the response string Pipe.Reader.t.

    • parameter code

      Default is HTTP 200 `OK

    val respond_string : - ?flush:bool -> ?headers:Http.Header.t -> ?status:Http.Status.t -> string -> @@ -26,7 +23,6 @@ ?headers:Http.Header.t -> Uri.t -> response Async_kernel.Deferred.t

    Respond with a redirect to an absolute uri

    • parameter uri

      Absolute URI to redirect the client to

    val respond_with_file : - ?flush:bool -> ?headers:Http.Header.t -> ?error_body:string -> string -> diff --git a/cohttp-async/Cohttp_async/index.html b/cohttp-async/Cohttp_async/index.html index 5b863f822..42b89e54d 100644 --- a/cohttp-async/Cohttp_async/index.html +++ b/cohttp-async/Cohttp_async/index.html @@ -1,2 +1,2 @@ -Cohttp_async (cohttp-async.Cohttp_async)

    Module Cohttp_async

    module Body : sig ... end
    module Body_raw = Body
    module Client : sig ... end
    module Io : sig ... end
    module Request = Cohttp.Request
    module Response = Cohttp.Response
    module Server : sig ... end
    +Cohttp_async (cohttp-async.Cohttp_async)

    Module Cohttp_async

    module Body : sig ... end
    module Body_raw = Body
    module Client : sig ... end
    module Io : sig ... end
    module Request = Cohttp.Request
    module Response = Cohttp.Response
    module Server : sig ... end
    diff --git a/cohttp-async/index.html b/cohttp-async/index.html index a47e000cc..720195c2a 100644 --- a/cohttp-async/index.html +++ b/cohttp-async/index.html @@ -1,2 +1,2 @@ -index (cohttp-async.index)

    cohttp-async index

    Library cohttp-async

    The entry point of this library is the module: Cohttp_async.

    +index (cohttp-async.index)

    cohttp-async index

    Library cohttp-async

    The entry point of this library is the module: Cohttp_async.

    diff --git a/cohttp-bench/index.html b/cohttp-bench/index.html index 191d70167..2c18308fe 100644 --- a/cohttp-bench/index.html +++ b/cohttp-bench/index.html @@ -1,2 +1,2 @@ -index (cohttp-bench.index)

    cohttp-bench index

    +index (cohttp-bench.index)

    cohttp-bench index

    diff --git a/cohttp-curl-async/index.html b/cohttp-curl-async/index.html index 2070cc460..1c8d36feb 100644 --- a/cohttp-curl-async/index.html +++ b/cohttp-curl-async/index.html @@ -1,2 +1,2 @@ -index (cohttp-curl-async.index)

    cohttp-curl-async index

    +index (cohttp-curl-async.index)

    cohttp-curl-async index

    diff --git a/cohttp-curl-lwt/Cohttp_curl_lwt/Context/index.html b/cohttp-curl-lwt/Cohttp_curl_lwt/Context/index.html index b8585ea6f..acf5fb15a 100644 --- a/cohttp-curl-lwt/Cohttp_curl_lwt/Context/index.html +++ b/cohttp-curl-lwt/Cohttp_curl_lwt/Context/index.html @@ -1,2 +1,2 @@ -Context (cohttp-curl-lwt.Cohttp_curl_lwt.Context)

    Module Cohttp_curl_lwt.Context

    A context shares the curl event handling logic for all curl requests associated to it

    type t
    val create : unit -> t
    +Context (cohttp-curl-lwt.Cohttp_curl_lwt.Context)

    Module Cohttp_curl_lwt.Context

    A context shares the curl event handling logic for all curl requests associated to it

    type t
    val create : unit -> t
    diff --git a/cohttp-curl-lwt/Cohttp_curl_lwt/Error/index.html b/cohttp-curl-lwt/Cohttp_curl_lwt/Error/index.html new file mode 100644 index 000000000..e3cc4b48b --- /dev/null +++ b/cohttp-curl-lwt/Cohttp_curl_lwt/Error/index.html @@ -0,0 +1,2 @@ + +Error (cohttp-curl-lwt.Cohttp_curl_lwt.Error)

    Module Cohttp_curl_lwt.Error

    type t
    val message : t -> string
    val is_timeout : t -> bool
    diff --git a/cohttp-curl-lwt/Cohttp_curl_lwt/Request/Expert/index.html b/cohttp-curl-lwt/Cohttp_curl_lwt/Request/Expert/index.html index 3425362ea..36b35daad 100644 --- a/cohttp-curl-lwt/Cohttp_curl_lwt/Request/Expert/index.html +++ b/cohttp-curl-lwt/Cohttp_curl_lwt/Request/Expert/index.html @@ -1,2 +1,2 @@ -Expert (cohttp-curl-lwt.Cohttp_curl_lwt.Request.Expert)

    Module Request.Expert

    val curl : _ t -> Curl.t
    +Expert (cohttp-curl-lwt.Cohttp_curl_lwt.Request.Expert)

    Module Request.Expert

    val curl : _ t -> Curl.t
    diff --git a/cohttp-curl-lwt/Cohttp_curl_lwt/Request/index.html b/cohttp-curl-lwt/Cohttp_curl_lwt/Request/index.html index 31d319463..93b60404f 100644 --- a/cohttp-curl-lwt/Cohttp_curl_lwt/Request/index.html +++ b/cohttp-curl-lwt/Cohttp_curl_lwt/Request/index.html @@ -1,5 +1,5 @@ -Request (cohttp-curl-lwt.Cohttp_curl_lwt.Request)

    Module Cohttp_curl_lwt.Request

    Http requests

    type 'a t

    'a t represents an http request 'a determines how the response body is handled.

    val create : +Request (cohttp-curl-lwt.Cohttp_curl_lwt.Request)

    Module Cohttp_curl_lwt.Request

    Http requests

    type 'a t

    'a t represents an http request 'a determines how the response body is handled.

    val create : ?timeout_ms:int -> ?headers:Http.Header.t -> Http.Method.t -> diff --git a/cohttp-curl-lwt/Cohttp_curl_lwt/Response/Expert/index.html b/cohttp-curl-lwt/Cohttp_curl_lwt/Response/Expert/index.html index 75ba3709d..ded58574e 100644 --- a/cohttp-curl-lwt/Cohttp_curl_lwt/Response/Expert/index.html +++ b/cohttp-curl-lwt/Cohttp_curl_lwt/Response/Expert/index.html @@ -1,2 +1,2 @@ -Expert (cohttp-curl-lwt.Cohttp_curl_lwt.Response.Expert)

    Module Response.Expert

    val curl : _ t -> Curl.t
    +Expert (cohttp-curl-lwt.Cohttp_curl_lwt.Response.Expert)

    Module Response.Expert

    val curl : _ t -> Curl.t
    diff --git a/cohttp-curl-lwt/Cohttp_curl_lwt/Response/index.html b/cohttp-curl-lwt/Cohttp_curl_lwt/Response/index.html index 0f41104f2..225d1ee78 100644 --- a/cohttp-curl-lwt/Cohttp_curl_lwt/Response/index.html +++ b/cohttp-curl-lwt/Cohttp_curl_lwt/Response/index.html @@ -1,2 +1,2 @@ -Response (cohttp-curl-lwt.Cohttp_curl_lwt.Response)

    Module Cohttp_curl_lwt.Response

    Response for the http requests

    type 'a t

    'a t represents a response for a request. 'a determines how the response body is handled

    val response : _ t -> Http.Response.t Lwt.t
    val body : 'a t -> 'a Lwt.t
    module Expert : sig ... end
    +Response (cohttp-curl-lwt.Cohttp_curl_lwt.Response)

    Module Cohttp_curl_lwt.Response

    Response for the http requests

    type 'a t

    'a t represents a response for a request. 'a determines how the response body is handled

    val response : _ t -> (Http.Response.t, Error.t) Stdlib.result Lwt.t
    val body : 'a t -> ('a, Error.t) Stdlib.result Lwt.t
    module Expert : sig ... end
    diff --git a/cohttp-curl-lwt/Cohttp_curl_lwt/Sink/index.html b/cohttp-curl-lwt/Cohttp_curl_lwt/Sink/index.html index f399c0b4e..8748137b5 100644 --- a/cohttp-curl-lwt/Cohttp_curl_lwt/Sink/index.html +++ b/cohttp-curl-lwt/Cohttp_curl_lwt/Sink/index.html @@ -1,2 +1,2 @@ -Sink (cohttp-curl-lwt.Cohttp_curl_lwt.Sink)

    Module Cohttp_curl_lwt.Sink

    A sink defines where the response body may be written

    type 'a t
    val string : string t
    val discard : unit t
    +Sink (cohttp-curl-lwt.Cohttp_curl_lwt.Sink)

    Module Cohttp_curl_lwt.Sink

    A sink defines where the response body may be written

    type 'a t
    val string : string t
    val discard : unit t
    diff --git a/cohttp-curl-lwt/Cohttp_curl_lwt/Source/index.html b/cohttp-curl-lwt/Cohttp_curl_lwt/Source/index.html index e7fa6f408..6c5472d05 100644 --- a/cohttp-curl-lwt/Cohttp_curl_lwt/Source/index.html +++ b/cohttp-curl-lwt/Cohttp_curl_lwt/Source/index.html @@ -1,2 +1,2 @@ -Source (cohttp-curl-lwt.Cohttp_curl_lwt.Source)

    Module Cohttp_curl_lwt.Source

    A source defines where the request body is read from

    type t
    val empty : t
    val string : string -> t
    +Source (cohttp-curl-lwt.Cohttp_curl_lwt.Source)

    Module Cohttp_curl_lwt.Source

    A source defines where the request body is read from

    type t
    val empty : t
    val string : string -> t
    diff --git a/cohttp-curl-lwt/Cohttp_curl_lwt/index.html b/cohttp-curl-lwt/Cohttp_curl_lwt/index.html index c3de15043..4ce6e8f54 100644 --- a/cohttp-curl-lwt/Cohttp_curl_lwt/index.html +++ b/cohttp-curl-lwt/Cohttp_curl_lwt/index.html @@ -1,2 +1,2 @@ -Cohttp_curl_lwt (cohttp-curl-lwt.Cohttp_curl_lwt)

    Module Cohttp_curl_lwt

    Curl based client

    module Sink : sig ... end

    A sink defines where the response body may be written

    module Source : sig ... end

    A source defines where the request body is read from

    module Context : sig ... end

    A context shares the curl event handling logic for all curl requests associated to it

    module Response : sig ... end

    Response for the http requests

    module Request : sig ... end

    Http requests

    val submit : Context.t -> 'a Request.t -> 'a Response.t

    submit ctx request submits a request and returns the response. Once a request is submitted, it may not be submitted again.

    +Cohttp_curl_lwt (cohttp-curl-lwt.Cohttp_curl_lwt)

    Module Cohttp_curl_lwt

    Curl based client

    module Sink : sig ... end

    A sink defines where the response body may be written

    module Source : sig ... end

    A source defines where the request body is read from

    module Context : sig ... end

    A context shares the curl event handling logic for all curl requests associated to it

    module Error : sig ... end
    module Response : sig ... end

    Response for the http requests

    module Request : sig ... end

    Http requests

    val submit : Context.t -> 'a Request.t -> 'a Response.t

    submit ctx request submits a request and returns the response. Once a request is submitted, it may not be submitted again.

    diff --git a/cohttp-curl-lwt/index.html b/cohttp-curl-lwt/index.html index fd312d685..1bab529b0 100644 --- a/cohttp-curl-lwt/index.html +++ b/cohttp-curl-lwt/index.html @@ -1,2 +1,2 @@ -index (cohttp-curl-lwt.index)

    cohttp-curl-lwt index

    Library cohttp-curl-lwt

    The entry point of this library is the module: Cohttp_curl_lwt.

    +index (cohttp-curl-lwt.index)

    cohttp-curl-lwt index

    Library cohttp-curl-lwt

    The entry point of this library is the module: Cohttp_curl_lwt.

    diff --git a/cohttp-curl/Cohttp_curl/Private/Error/index.html b/cohttp-curl/Cohttp_curl/Private/Error/index.html new file mode 100644 index 000000000..8460acb4a --- /dev/null +++ b/cohttp-curl/Cohttp_curl/Private/Error/index.html @@ -0,0 +1,2 @@ + +Error (cohttp-curl.Cohttp_curl.Private.Error)

    Module Private.Error

    type t
    val create : Curl.curlCode -> t
    val message : t -> string
    val is_timeout : t -> bool
    diff --git a/cohttp-curl/Cohttp_curl/Private/Request/index.html b/cohttp-curl/Cohttp_curl/Private/Request/index.html index 834e87743..5eeeb60cc 100644 --- a/cohttp-curl/Cohttp_curl/Private/Request/index.html +++ b/cohttp-curl/Cohttp_curl/Private/Request/index.html @@ -1,5 +1,5 @@ -Request (cohttp-curl.Cohttp_curl.Private.Request)

    Module Private.Request

    type 'a t
    val curl : _ t -> Curl.t
    val body : 'a t -> 'a

    body t this must be called after curl completes the requests. it can only be called once

    val create : +Request (cohttp-curl.Cohttp_curl.Private.Request)

    Module Private.Request

    type 'a t
    val curl : _ t -> Curl.t
    val body : 'a t -> 'a

    body t this must be called after curl completes the requests. it can only be called once

    val create : ?timeout_ms:int -> ?headers:Http.Header.t -> Http.Method.t -> diff --git a/cohttp-curl/Cohttp_curl/Private/Sink/index.html b/cohttp-curl/Cohttp_curl/Private/Sink/index.html index 6c4c69e03..619a331cd 100644 --- a/cohttp-curl/Cohttp_curl/Private/Sink/index.html +++ b/cohttp-curl/Cohttp_curl/Private/Sink/index.html @@ -1,2 +1,2 @@ -Sink (cohttp-curl.Cohttp_curl.Private.Sink)

    Module Private.Sink

    type 'a t
    val string : string t
    val discard : unit t
    +Sink (cohttp-curl.Cohttp_curl.Private.Sink)

    Module Private.Sink

    type 'a t
    val string : string t
    val discard : unit t
    diff --git a/cohttp-curl/Cohttp_curl/Private/Source/index.html b/cohttp-curl/Cohttp_curl/Private/Source/index.html index 025d3562c..df59a64ba 100644 --- a/cohttp-curl/Cohttp_curl/Private/Source/index.html +++ b/cohttp-curl/Cohttp_curl/Private/Source/index.html @@ -1,2 +1,2 @@ -Source (cohttp-curl.Cohttp_curl.Private.Source)

    Module Private.Source

    type t
    val empty : t
    val string : string -> t
    +Source (cohttp-curl.Cohttp_curl.Private.Source)

    Module Private.Source

    type t
    val empty : t
    val string : string -> t
    diff --git a/cohttp-curl/Cohttp_curl/Private/index.html b/cohttp-curl/Cohttp_curl/Private/index.html index 43cb8d9fc..c61d8922d 100644 --- a/cohttp-curl/Cohttp_curl/Private/index.html +++ b/cohttp-curl/Cohttp_curl/Private/index.html @@ -1,2 +1,2 @@ -Private (cohttp-curl.Cohttp_curl.Private)

    Module Cohttp_curl.Private

    module Sink : sig ... end
    module Source : sig ... end
    module Request : sig ... end
    +Private (cohttp-curl.Cohttp_curl.Private)

    Module Cohttp_curl.Private

    module Error : sig ... end
    module Sink : sig ... end
    module Source : sig ... end
    module Request : sig ... end
    diff --git a/cohttp-curl/Cohttp_curl/index.html b/cohttp-curl/Cohttp_curl/index.html index f5651abdb..de3f80106 100644 --- a/cohttp-curl/Cohttp_curl/index.html +++ b/cohttp-curl/Cohttp_curl/index.html @@ -1,2 +1,2 @@ -Cohttp_curl (cohttp-curl.Cohttp_curl)

    Module Cohttp_curl

    module Private : sig ... end
    +Cohttp_curl (cohttp-curl.Cohttp_curl)

    Module Cohttp_curl

    module Private : sig ... end
    diff --git a/cohttp-curl/index.html b/cohttp-curl/index.html index 667614977..53b600801 100644 --- a/cohttp-curl/index.html +++ b/cohttp-curl/index.html @@ -1,2 +1,2 @@ -index (cohttp-curl.index)

    cohttp-curl index

    Library cohttp-curl

    The entry point of this library is the module: Cohttp_curl.

    +index (cohttp-curl.index)

    cohttp-curl index

    Library cohttp-curl

    The entry point of this library is the module: Cohttp_curl.

    diff --git a/cohttp-eio/Cohttp_eio/Body/String_source/index.html b/cohttp-eio/Cohttp_eio/Body/String_source/index.html index 038bb80ca..e5b966655 100644 --- a/cohttp-eio/Cohttp_eio/Body/String_source/index.html +++ b/cohttp-eio/Cohttp_eio/Body/String_source/index.html @@ -1,2 +1,2 @@ -String_source (cohttp-eio.Cohttp_eio.Body.String_source)

    Module Body.String_source

    type t = {
    1. s : string;
    2. mutable offset : int;
    }
    val single_read : t -> Cstruct.t -> int
    val original_string : t -> string
    val read_methods : t Eio.Flow.read_method list
    val create : string -> t
    +String_source (cohttp-eio.Cohttp_eio.Body.String_source)

    Module Body.String_source

    type t = {
    1. s : string;
    2. mutable offset : int;
    }
    val single_read : t -> Cstruct.t -> int
    val original_string : t -> string
    val read_methods : t Eio.Flow.read_method list
    val create : string -> t
    diff --git a/cohttp-eio/Cohttp_eio/Body/index.html b/cohttp-eio/Cohttp_eio/Body/index.html index 7c1107613..c613f3cac 100644 --- a/cohttp-eio/Cohttp_eio/Body/index.html +++ b/cohttp-eio/Cohttp_eio/Body/index.html @@ -1,2 +1,2 @@ -Body (cohttp-eio.Cohttp_eio.Body)

    Module Cohttp_eio.Body

    type t = Eio.Flow.source_ty Eio.Resource.t
    type Eio.Flow.read_method +=
    1. | String of 't0 -> string
    module String_source : sig ... end
    val of_string : string -> Eio.Flow.source_ty Eio.Resource.t
    +Body (cohttp-eio.Cohttp_eio.Body)

    Module Cohttp_eio.Body

    type t = Eio.Flow.source_ty Eio.Resource.t
    type Eio.Flow.read_method +=
    1. | String of 't -> string
    module String_source : sig ... end
    val of_string : string -> Eio.Flow.source_ty Eio.Resource.t
    diff --git a/cohttp-eio/Cohttp_eio/Client/index.html b/cohttp-eio/Cohttp_eio/Client/index.html index aac7b8e85..74cd9c5e5 100644 --- a/cohttp-eio/Cohttp_eio/Client/index.html +++ b/cohttp-eio/Cohttp_eio/Client/index.html @@ -1,5 +1,5 @@ -Client (cohttp-eio.Cohttp_eio.Client)

    Module Cohttp_eio.Client

    type t
    include Cohttp.Generic.Client.S +Client (cohttp-eio.Cohttp_eio.Client)

    Module Cohttp_eio.Client

    type t
    include Cohttp.Generic.Client.S with type 'a with_context = t -> sw:Eio.Std.Switch.t -> 'a and type 'a io = 'a and type body = Body.t
    type 'a io = 'a
    type 'a with_context = t -> sw:Eio.Std.Switch.t -> 'a
    type body = Body.t
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : @@ -41,6 +41,4 @@ _ Eio.Flow.two_way) option -> _ Eio.Net.t -> - t

    make ~https net is a convenience wrapper around make_generic that uses net to make connections.

    • URIs of the form "http://host:port/..." connect to the given TCP host and port.
    • URIs of the form "https://host:port/..." connect to the given TCP host and port, and are then wrapped by https (or rejected if that is None).
    • URIs of the form "httpunix://unix-path/http-path" connect to the given Unix path.
    val make_generic : - (sw:Eio.Std.Switch.t -> Uri.t -> _ Eio.Net.stream_socket) -> - t

    make_generic connect is an HTTP client that uses connect to get the connection to use for a given URI.

    + t

    make ~https net is a convenience wrapper around make_generic that uses net to make connections.

    • URIs of the form "http://host:port/..." connect to the given TCP host and port.
    • URIs of the form "https://host:port/..." connect to the given TCP host and port, and are then wrapped by https (or rejected if that is None).
    • URIs of the form "httpunix://unix-path/http-path" connect to the given Unix path.
    val make_generic : (sw:Eio.Std.Switch.t -> Uri.t -> _ Eio.Flow.two_way) -> t

    make_generic connect is an HTTP client that uses connect to get the connection to use for a given URI.

    diff --git a/cohttp-eio/Cohttp_eio/Private/IO/index.html b/cohttp-eio/Cohttp_eio/Private/IO/index.html index adf21ad25..06c4ce89f 100644 --- a/cohttp-eio/Cohttp_eio/Private/IO/index.html +++ b/cohttp-eio/Cohttp_eio/Private/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-eio.Cohttp_eio.Private.IO)

    Module Private.IO

    type 'a t = 'a

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic = Eio.Buf_read.t

    ic represents an input channel

    type oc = Eio.Buf_write.t

    oc represents an output channel

    type conn = Eio.Switch.t * Eio.Net.Sockaddr.stream

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-eio.Cohttp_eio.Private.IO)

    Module Private.IO

    type 'a t = 'a

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic = Eio.Buf_read.t

    ic represents an input channel

    type oc = Eio.Buf_write.t

    oc represents an output channel

    type conn = Eio.Switch.t * Eio.Net.Sockaddr.stream

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    diff --git a/cohttp-eio/Cohttp_eio/Private/index.html b/cohttp-eio/Cohttp_eio/Private/index.html index 3772acabd..0be362c50 100644 --- a/cohttp-eio/Cohttp_eio/Private/index.html +++ b/cohttp-eio/Cohttp_eio/Private/index.html @@ -1,2 +1,2 @@ -Private (cohttp-eio.Cohttp_eio.Private)

    Module Cohttp_eio.Private

    module IO : sig ... end
    +Private (cohttp-eio.Cohttp_eio.Private)

    Module Cohttp_eio.Private

    module IO : sig ... end
    diff --git a/cohttp-eio/Cohttp_eio/Server/IO/index.html b/cohttp-eio/Cohttp_eio/Server/IO/index.html index 3173c7b78..11dc43c7b 100644 --- a/cohttp-eio/Cohttp_eio/Server/IO/index.html +++ b/cohttp-eio/Cohttp_eio/Server/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-eio.Cohttp_eio.Server.IO)

    Module Server.IO

    type 'a t = 'a

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic = Eio.Buf_read.t

    ic represents an input channel

    type oc = Eio.Buf_write.t

    oc represents an output channel

    type conn = Eio.Switch.t * Eio.Net.Sockaddr.stream

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-eio.Cohttp_eio.Server.IO)

    Module Server.IO

    type 'a t = 'a

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic = Eio.Buf_read.t

    ic represents an input channel

    type oc = Eio.Buf_write.t

    oc represents an output channel

    type conn = Eio.Switch.t * Eio.Net.Sockaddr.stream

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    diff --git a/cohttp-eio/Cohttp_eio/Server/index.html b/cohttp-eio/Cohttp_eio/Server/index.html index fc1c323cd..77553bd1f 100644 --- a/cohttp-eio/Cohttp_eio/Server/index.html +++ b/cohttp-eio/Cohttp_eio/Server/index.html @@ -1,7 +1,8 @@ -Server (cohttp-eio.Cohttp_eio.Server)

    Module Cohttp_eio.Server

    include Cohttp.Generic.Server.S +Server (cohttp-eio.Cohttp_eio.Server)

    Module Cohttp_eio.Server

    type writer
    include Cohttp.Generic.Server.S with module IO = Cohttp_eio__.Io.IO - and type body = Body.t
    module IO : sig ... end
    type body = Body.t
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of Http.Response.t * body
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unitIO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : + and type body = Body.t + and type response = writer -> unit
    module IO : sig ... end
    type body = Body.t
    type response = writer -> unit
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of response
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unit IO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : ?conn_closed:(conn -> unit) -> callback:(conn -> Http.Request.t -> body -> response_action IO.t) -> unit -> @@ -15,21 +16,19 @@ unit -> t
    val make : ?conn_closed:(conn -> unit) -> - callback:(conn -> Http.Request.t -> body -> (Http.Response.t * body) IO.t) -> + callback:(conn -> Http.Request.t -> body -> response IO.t) -> unit -> - t
    val respond : + t
    val respond_string : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> - body:body -> + body:string -> unit -> - (Http.Response.t * body) IO.t

    respond ?headers ?flush ~status ~body will respond to an HTTP request with the given status code and response body. If flush is true, then every response chunk will be flushed to the network rather than being buffered. flush is true by default. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : + response IO.t
    val callback : t -> IO.conn -> IO.ic -> IO.oc -> unit IO.t
    val respond : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> - body:string -> + body:_ Eio.Flow.source -> unit -> - (Http.Response.t * body) IO.t
    val callback : t -> IO.conn -> IO.ic -> IO.oc -> unit IO.t
    val run : + response IO.t
    val run : ?max_connections:int -> ?additional_domains:(_ Eio__Domain_manager.t * int) -> ?stop:'a Eio.Promise.t -> diff --git a/cohttp-eio/Cohttp_eio/index.html b/cohttp-eio/Cohttp_eio/index.html index 949ed7d39..2df74b42f 100644 --- a/cohttp-eio/Cohttp_eio/index.html +++ b/cohttp-eio/Cohttp_eio/index.html @@ -1,2 +1,2 @@ -Cohttp_eio (cohttp-eio.Cohttp_eio)

    Module Cohttp_eio

    module Body : sig ... end
    module Client : sig ... end
    module Server : sig ... end
    module Private : sig ... end
    val src : Logs.src
    +Cohttp_eio (cohttp-eio.Cohttp_eio)

    Module Cohttp_eio

    module Body : sig ... end
    module Client : sig ... end
    module Server : sig ... end
    module Private : sig ... end
    val src : Logs.src
    diff --git a/cohttp-eio/index.html b/cohttp-eio/index.html index 596274700..edb65a64a 100644 --- a/cohttp-eio/index.html +++ b/cohttp-eio/index.html @@ -1,2 +1,2 @@ -index (cohttp-eio.index)

    cohttp-eio index

    Library cohttp-eio

    The entry point of this library is the module: Cohttp_eio.

    +index (cohttp-eio.index)

    cohttp-eio index

    Library cohttp-eio

    The entry point of this library is the module: Cohttp_eio.

    diff --git a/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Client/index.html b/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Client/index.html index 8062f9676..f6a0aa0e1 100644 --- a/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Client/index.html +++ b/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Client/index.html @@ -1,5 +1,5 @@ -Client (cohttp-lwt-jsoo.Cohttp_lwt_jsoo.Client)

    Module Cohttp_lwt_jsoo.Client

    The Client module implements an HTTP client interface using asynchronous XmlHttpRequests. The response body is returned in chucked form with 128Kb / chunk. Body data is treated as raw bytes. withCredentials property of XHR is set to false.

    type ctx
    • parameter ctx

      If provided, no connection cache is used, but Connection_cache.Make_no_cache.create is used to resolve uri and create a dedicated connection with ctx.

      In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.

    include Cohttp.Generic.Client.S +Client (cohttp-lwt-jsoo.Cohttp_lwt_jsoo.Client)

    Module Cohttp_lwt_jsoo.Client

    The Client module implements an HTTP client interface using asynchronous XmlHttpRequests. The response body is returned in chucked form with 128Kb / chunk. Body data is treated as raw bytes. withCredentials property of XHR is set to false.

    type ctx
    • parameter ctx

      If provided, no connection cache is used, but Connection_cache.Make_no_cache.create is used to resolve uri and create a dedicated connection with ctx.

      In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.

    include Cohttp.Generic.Client.S with type 'a io = 'a Lwt.t and type body = Cohttp_lwt.Body.t and type 'a with_context = ?ctx:ctx -> 'a
    type 'a io = 'a Lwt.t
    type 'a with_context = ?ctx:ctx -> 'a
    type body = Cohttp_lwt.Body.t
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : @@ -43,4 +43,4 @@ ?ctx:ctx -> Uri.t -> (Http.Request.t * Cohttp_lwt.Body.t) Lwt_stream.t -> - (Http.Response.t * Cohttp_lwt.Body.t) Lwt_stream.t Lwt.t
    • deprecated

      use moduleCohttp_lwt.Connection instead.

    + (Http.Response.t * Cohttp_lwt.Body.t) Lwt_stream.t Lwt.t
    diff --git a/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Client_sync/index.html b/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Client_sync/index.html index a84b020fc..1a410cf1d 100644 --- a/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Client_sync/index.html +++ b/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Client_sync/index.html @@ -1,5 +1,5 @@ -Client_sync (cohttp-lwt-jsoo.Cohttp_lwt_jsoo.Client_sync)

    Module Cohttp_lwt_jsoo.Client_sync

    The Client_sync module implements an HTTP client interface using synchronous XmlHttpRequests. The response is not chunked and treated as raw bytes. withCredentials property of XHR is set to false.

    type ctx
    • parameter ctx

      If provided, no connection cache is used, but Connection_cache.Make_no_cache.create is used to resolve uri and create a dedicated connection with ctx.

      In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.

    include Cohttp.Generic.Client.S +Client_sync (cohttp-lwt-jsoo.Cohttp_lwt_jsoo.Client_sync)

    Module Cohttp_lwt_jsoo.Client_sync

    The Client_sync module implements an HTTP client interface using synchronous XmlHttpRequests. The response is not chunked and treated as raw bytes. withCredentials property of XHR is set to false.

    type ctx
    • parameter ctx

      If provided, no connection cache is used, but Connection_cache.Make_no_cache.create is used to resolve uri and create a dedicated connection with ctx.

      In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.

    include Cohttp.Generic.Client.S with type 'a io = 'a Lwt.t and type body = Cohttp_lwt.Body.t and type 'a with_context = ?ctx:ctx -> 'a
    type 'a io = 'a Lwt.t
    type 'a with_context = ?ctx:ctx -> 'a
    type body = Cohttp_lwt.Body.t
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : @@ -43,4 +43,4 @@ ?ctx:ctx -> Uri.t -> (Http.Request.t * Cohttp_lwt.Body.t) Lwt_stream.t -> - (Http.Response.t * Cohttp_lwt.Body.t) Lwt_stream.t Lwt.t
    • deprecated

      use moduleCohttp_lwt.Connection instead.

    + (Http.Response.t * Cohttp_lwt.Body.t) Lwt_stream.t Lwt.t
    diff --git a/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_async/argument-1-P/index.html b/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_async/argument-1-_/index.html similarity index 85% rename from cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_async/argument-1-P/index.html rename to cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_async/argument-1-_/index.html index 7c8a2870c..7ca4f1474 100644 --- a/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_async/argument-1-P/index.html +++ b/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_async/argument-1-_/index.html @@ -1,2 +1,2 @@ -P (cohttp-lwt-jsoo.Cohttp_lwt_jsoo.Make_client_async.P)

    Parameter Make_client_async.P

    val chunked_response : bool

    Should the response body data be chunked?

    val chunk_size : int

    Size of chunks

    val convert_body_string : Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t -> string

    JavaScript string to OCaml conversion. Js.to_bytestring or Js.to_string

    val with_credentials : bool

    Whether withCredentials property of XHR is set.

    +_ (cohttp-lwt-jsoo.Cohttp_lwt_jsoo.Make_client_async._)

    Parameter Make_client_async._

    val chunked_response : bool

    Should the response body data be chunked?

    val chunk_size : int

    Size of chunks

    val convert_body_string : Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t -> string

    JavaScript string to OCaml conversion. Js.to_bytestring or Js.to_string

    val with_credentials : bool

    Whether withCredentials property of XHR is set.

    diff --git a/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_async/index.html b/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_async/index.html index 899287070..6c5c1d7da 100644 --- a/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_async/index.html +++ b/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_async/index.html @@ -1,5 +1,5 @@ -Make_client_async (cohttp-lwt-jsoo.Cohttp_lwt_jsoo.Make_client_async)

    Module Cohttp_lwt_jsoo.Make_client_async

    Build an asynchronous engine with chunked/unchucked response data treated as raw bytes or UTF

    Parameters

    module P : Params

    Signature

    type ctx
    • parameter ctx

      If provided, no connection cache is used, but Connection_cache.Make_no_cache.create is used to resolve uri and create a dedicated connection with ctx.

      In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.

    include Cohttp.Generic.Client.S +Make_client_async (cohttp-lwt-jsoo.Cohttp_lwt_jsoo.Make_client_async)

    Module Cohttp_lwt_jsoo.Make_client_async

    Build an asynchronous engine with chunked/unchucked response data treated as raw bytes or UTF

    Parameters

    module _ : Params

    Signature

    type ctx
    • parameter ctx

      If provided, no connection cache is used, but Connection_cache.Make_no_cache.create is used to resolve uri and create a dedicated connection with ctx.

      In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.

    include Cohttp.Generic.Client.S with type 'a io = 'a Lwt.t and type body = Cohttp_lwt.Body.t and type 'a with_context = ?ctx:ctx -> 'a
    type 'a io = 'a Lwt.t
    type 'a with_context = ?ctx:ctx -> 'a
    type body = Cohttp_lwt.Body.t
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : @@ -43,4 +43,4 @@ ?ctx:ctx -> Uri.t -> (Http.Request.t * Cohttp_lwt.Body.t) Lwt_stream.t -> - (Http.Response.t * Cohttp_lwt.Body.t) Lwt_stream.t Lwt.t
    • deprecated

      use moduleCohttp_lwt.Connection instead.

    + (Http.Response.t * Cohttp_lwt.Body.t) Lwt_stream.t Lwt.t
    diff --git a/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_sync/argument-1-P/index.html b/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_sync/argument-1-_/index.html similarity index 85% rename from cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_sync/argument-1-P/index.html rename to cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_sync/argument-1-_/index.html index 671977431..b4d8c427b 100644 --- a/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_sync/argument-1-P/index.html +++ b/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_sync/argument-1-_/index.html @@ -1,2 +1,2 @@ -P (cohttp-lwt-jsoo.Cohttp_lwt_jsoo.Make_client_sync.P)

    Parameter Make_client_sync.P

    val chunked_response : bool

    Should the response body data be chunked?

    val chunk_size : int

    Size of chunks

    val convert_body_string : Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t -> string

    JavaScript string to OCaml conversion. Js.to_bytestring or Js.to_string

    val with_credentials : bool

    Whether withCredentials property of XHR is set.

    +_ (cohttp-lwt-jsoo.Cohttp_lwt_jsoo.Make_client_sync._)

    Parameter Make_client_sync._

    val chunked_response : bool

    Should the response body data be chunked?

    val chunk_size : int

    Size of chunks

    val convert_body_string : Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t -> string

    JavaScript string to OCaml conversion. Js.to_bytestring or Js.to_string

    val with_credentials : bool

    Whether withCredentials property of XHR is set.

    diff --git a/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_sync/index.html b/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_sync/index.html index b961a66e2..7a3ff4fbb 100644 --- a/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_sync/index.html +++ b/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/Make_client_sync/index.html @@ -1,5 +1,5 @@ -Make_client_sync (cohttp-lwt-jsoo.Cohttp_lwt_jsoo.Make_client_sync)

    Module Cohttp_lwt_jsoo.Make_client_sync

    Build a synchronous engine with chunked/unchucked response data treated as raw bytes or UTF

    Parameters

    module P : Params

    Signature

    type ctx
    • parameter ctx

      If provided, no connection cache is used, but Connection_cache.Make_no_cache.create is used to resolve uri and create a dedicated connection with ctx.

      In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.

    include Cohttp.Generic.Client.S +Make_client_sync (cohttp-lwt-jsoo.Cohttp_lwt_jsoo.Make_client_sync)

    Module Cohttp_lwt_jsoo.Make_client_sync

    Build a synchronous engine with chunked/unchucked response data treated as raw bytes or UTF

    Parameters

    module _ : Params

    Signature

    type ctx
    • parameter ctx

      If provided, no connection cache is used, but Connection_cache.Make_no_cache.create is used to resolve uri and create a dedicated connection with ctx.

      In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.

    include Cohttp.Generic.Client.S with type 'a io = 'a Lwt.t and type body = Cohttp_lwt.Body.t and type 'a with_context = ?ctx:ctx -> 'a
    type 'a io = 'a Lwt.t
    type 'a with_context = ?ctx:ctx -> 'a
    type body = Cohttp_lwt.Body.t
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : @@ -43,4 +43,4 @@ ?ctx:ctx -> Uri.t -> (Http.Request.t * Cohttp_lwt.Body.t) Lwt_stream.t -> - (Http.Response.t * Cohttp_lwt.Body.t) Lwt_stream.t Lwt.t
    • deprecated

      use moduleCohttp_lwt.Connection instead.

    + (Http.Response.t * Cohttp_lwt.Body.t) Lwt_stream.t Lwt.t
    diff --git a/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/index.html b/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/index.html index a1275d6be..ccc83a49f 100644 --- a/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/index.html +++ b/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/index.html @@ -1,3 +1,3 @@ -Cohttp_lwt_jsoo (cohttp-lwt-jsoo.Cohttp_lwt_jsoo)

    Module Cohttp_lwt_jsoo

    HTTP client for JavaScript using XMLHttpRequest.

    The Logs source name for this module's logger is "cohttp.lwt.jsoo". To log the current warnings using the browser's console log, you can write a custom reporter or use:

    let reporter = Logs_browser.console_reporter () in
    -Logs.set_reporter reporter
    module type Params = sig ... end

    Configuration parameters for the XmlHttpRequest engines

    Build an asynchronous engine with chunked/unchucked response data treated as raw bytes or UTF

    Build a synchronous engine with chunked/unchucked response data treated as raw bytes or UTF

    The Client module implements an HTTP client interface using asynchronous XmlHttpRequests. The response body is returned in chucked form with 128Kb / chunk. Body data is treated as raw bytes. withCredentials property of XHR is set to false.

    The Client_sync module implements an HTTP client interface using synchronous XmlHttpRequests. The response is not chunked and treated as raw bytes. withCredentials property of XHR is set to false.

    +Cohttp_lwt_jsoo (cohttp-lwt-jsoo.Cohttp_lwt_jsoo)

    Module Cohttp_lwt_jsoo

    HTTP client for JavaScript using XMLHttpRequest.

    The Logs source name for this module's logger is "cohttp.lwt.jsoo". To log the current warnings using the browser's console log, you can write a custom reporter or use:

    let reporter = Logs_browser.console_reporter () in
    +Logs.set_reporter reporter
    module type Params = sig ... end

    Configuration parameters for the XmlHttpRequest engines

    Build an asynchronous engine with chunked/unchucked response data treated as raw bytes or UTF

    Build a synchronous engine with chunked/unchucked response data treated as raw bytes or UTF

    The Client module implements an HTTP client interface using asynchronous XmlHttpRequests. The response body is returned in chucked form with 128Kb / chunk. Body data is treated as raw bytes. withCredentials property of XHR is set to false.

    The Client_sync module implements an HTTP client interface using synchronous XmlHttpRequests. The response is not chunked and treated as raw bytes. withCredentials property of XHR is set to false.

    diff --git a/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/module-type-Params/index.html b/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/module-type-Params/index.html index fd1de516c..cd5c6121f 100644 --- a/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/module-type-Params/index.html +++ b/cohttp-lwt-jsoo/Cohttp_lwt_jsoo/module-type-Params/index.html @@ -1,2 +1,2 @@ -Params (cohttp-lwt-jsoo.Cohttp_lwt_jsoo.Params)

    Module type Cohttp_lwt_jsoo.Params

    Configuration parameters for the XmlHttpRequest engines

    val chunked_response : bool

    Should the response body data be chunked?

    val chunk_size : int

    Size of chunks

    val convert_body_string : Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t -> string

    JavaScript string to OCaml conversion. Js.to_bytestring or Js.to_string

    val with_credentials : bool

    Whether withCredentials property of XHR is set.

    +Params (cohttp-lwt-jsoo.Cohttp_lwt_jsoo.Params)

    Module type Cohttp_lwt_jsoo.Params

    Configuration parameters for the XmlHttpRequest engines

    val chunked_response : bool

    Should the response body data be chunked?

    val chunk_size : int

    Size of chunks

    val convert_body_string : Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t -> string

    JavaScript string to OCaml conversion. Js.to_bytestring or Js.to_string

    val with_credentials : bool

    Whether withCredentials property of XHR is set.

    diff --git a/cohttp-lwt-jsoo/index.html b/cohttp-lwt-jsoo/index.html index 4a09d5b7e..b112676a1 100644 --- a/cohttp-lwt-jsoo/index.html +++ b/cohttp-lwt-jsoo/index.html @@ -1,2 +1,2 @@ -index (cohttp-lwt-jsoo.index)

    cohttp-lwt-jsoo index

    Library cohttp-lwt-jsoo

    The entry point of this library is the module: Cohttp_lwt_jsoo.

    +index (cohttp-lwt-jsoo.index)

    cohttp-lwt-jsoo index

    Library cohttp-lwt-jsoo

    The entry point of this library is the module: Cohttp_lwt_jsoo.

    diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Client/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Client/index.html index 5f93f33ec..8bc73bc49 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Client/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Client/index.html @@ -1,5 +1,5 @@ -Client (cohttp-lwt-unix.Cohttp_lwt_unix.Client)

    Module Cohttp_lwt_unix.Client

    The Client module implements the full UNIX HTTP client interface, including the UNIX-specific functions defined in C.

    include Cohttp_lwt.S.Client with type ctx = Net.ctx
    type ctx = Net.ctx
    • parameter ctx

      If provided, no connection cache is used, but Connection_cache.Make_no_cache.create is used to resolve uri and create a dedicated connection with ctx.

      In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.

    include Cohttp.Generic.Client.S +Client (cohttp-lwt-unix.Cohttp_lwt_unix.Client)

    Module Cohttp_lwt_unix.Client

    The Client module implements the full UNIX HTTP client interface, including the UNIX-specific functions defined in C.

    include Cohttp_lwt.S.Client with type ctx = Net.ctx
    type ctx = Net.ctx
    • parameter ctx

      If provided, no connection cache is used, but Connection_cache.Make_no_cache.create is used to resolve uri and create a dedicated connection with ctx.

      In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.

    include Cohttp.Generic.Client.S with type 'a io = 'a Lwt.t and type body = Cohttp_lwt.Body.t and type 'a with_context = ?ctx:ctx -> 'a
    type 'a io = 'a Lwt.t
    type 'a with_context = ?ctx:ctx -> 'a
    type body = Cohttp_lwt.Body.t
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : @@ -43,7 +43,7 @@ ?ctx:ctx -> Uri.t -> (Http.Request.t * Cohttp_lwt.Body.t) Lwt_stream.t -> - (Http.Response.t * Cohttp_lwt.Body.t) Lwt_stream.t Lwt.t
    • deprecated

      use moduleCohttp_lwt.Connection instead.

    val custom_ctx : + (Http.Response.t * Cohttp_lwt.Body.t) Lwt_stream.t Lwt.t
    val custom_ctx : ?ctx:Conduit_lwt_unix.ctx -> ?resolver:Resolver_lwt.t -> unit -> diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Connection/Net/IO/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Connection/Net/IO/index.html index a3371ed65..42a09daac 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Connection/Net/IO/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Connection/Net/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-lwt-unix.Cohttp_lwt_unix.Connection.Net.IO)

    Module Net.IO

    type 'a t = 'a Lwt.t
    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
    val return : 'a -> 'a t
    type ic = Net.IO.ic
    type oc = Net.IO.oc
    type conn = Net.IO.conn
    val refill : ic -> [ `Eof | `Ok ] t
    val with_input_buffer : +IO (cohttp-lwt-unix.Cohttp_lwt_unix.Connection.Net.IO)

    Module Net.IO

    type 'a t = 'a Lwt.t
    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
    val return : 'a -> 'a t
    type ic = Net.IO.ic
    type oc = Net.IO.oc
    type conn = Net.IO.conn
    val refill : ic -> [ `Eof | `Ok ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t
    val read : ic -> int -> string t
    val write : oc -> string -> unit t
    val flush : oc -> unit t
    type error = Net.IO.error
    val catch : (unit -> 'a t) -> ('a, error) Stdlib.result t
    val pp_error : Stdlib.Format.formatter -> error -> unit
    diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Connection/Net/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Connection/Net/index.html index b55196956..22eff4fc2 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Connection/Net/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Connection/Net/index.html @@ -1,2 +1,2 @@ -Net (cohttp-lwt-unix.Cohttp_lwt_unix.Connection.Net)

    Module Connection.Net

    module IO : sig ... end
    type endp = Net.endp
    type ctx = Net.ctx
    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx
    val resolve : ctx:ctx -> Uri.t -> endp IO.t
    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t
    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t
    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    +Net (cohttp-lwt-unix.Cohttp_lwt_unix.Connection.Net)

    Module Connection.Net

    module IO : sig ... end
    type endp = Net.endp
    type ctx = Net.ctx
    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx Stdlib.Lazy.t
    val resolve : ctx:ctx -> Uri.t -> endp IO.t
    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t
    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t
    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Connection/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Connection/index.html index 4493e5b83..e6a1142e0 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Connection/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Connection/index.html @@ -1,5 +1,5 @@ -Connection (cohttp-lwt-unix.Cohttp_lwt_unix.Connection)

    Module Cohttp_lwt_unix.Connection

    module Net : sig ... end
    exception Retry
    type t
    val create : +Connection (cohttp-lwt-unix.Cohttp_lwt_unix.Connection)

    Module Cohttp_lwt_unix.Connection

    module Net : sig ... end
    exception Retry
    type t
    val create : ?finalise:(t -> unit Net.IO.t) -> ?persistent:bool -> ?ctx:Net.ctx -> diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Connection_cache/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Connection_cache/index.html index 1db9fbb8d..b7d94e3b5 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Connection_cache/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Connection_cache/index.html @@ -1,5 +1,5 @@ -Connection_cache (cohttp-lwt-unix.Cohttp_lwt_unix.Connection_cache)

    Module Cohttp_lwt_unix.Connection_cache

    type t
    val call : +Connection_cache (cohttp-lwt-unix.Cohttp_lwt_unix.Connection_cache)

    Module Cohttp_lwt_unix.Connection_cache

    type t
    val call : t -> ?headers:Http.Header.t -> ?body:Cohttp_lwt.Body.t -> diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Debug/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Debug/index.html index 672b974cb..74f5e6b7e 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Debug/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Debug/index.html @@ -1,5 +1,5 @@ -Debug (cohttp-lwt-unix.Cohttp_lwt_unix.Debug)

    Module Cohttp_lwt_unix.Debug

    Debugging output for Cohttp Unix

    val default_reporter : Logs.reporter

    default_reporter provides a simple reporter that sends the logging output to stderr. For example, the code below enables logging at level level to stderr, using coloured output if possible.

    Fmt_tty.setup_std_outputs ();
    +Debug (cohttp-lwt-unix.Cohttp_lwt_unix.Debug)

    Module Cohttp_lwt_unix.Debug

    Debugging output for Cohttp Unix

    val default_reporter : Logs.reporter

    default_reporter provides a simple reporter that sends the logging output to stderr. For example, the code below enables logging at level level to stderr, using coloured output if possible.

    Fmt_tty.setup_std_outputs ();
     Logs.set_level ~all:true (Some level);
     Logs.set_reporter Debug.default_reporter
    val activate_debug : unit -> unit

    activate_debug enables debugging output that will be sent to standard error.

    val debug_active : unit -> bool

    debug_active returns true if activate_debug has been called and false otherwise

    Selectively disable cohttp logging

    It is possible to selectively disable cohttp internal logginb by filtering over the various modules logs names as follows.

    (* Set log level v for all loggers, this does also affect cohttp internal loggers *)
     Logs.set_level ~all:true level;
    diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/IO/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/IO/index.html
    index 456148862..1a1fa5373 100644
    --- a/cohttp-lwt-unix/Cohttp_lwt_unix/IO/index.html
    +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/IO/index.html
    @@ -1,5 +1,5 @@
     
    -IO (cohttp-lwt-unix.Cohttp_lwt_unix.IO)

    Module Cohttp_lwt_unix.IO

    • deprecated This module is not for public consumption

    The Io module contains the IO implementation for cohttp-lwt-unix.

    The Logs source name for this module logger is "cohttp.lwt.io". Refer to the Debug module for further details.

    include Cohttp_lwt.S.IO +IO (cohttp-lwt-unix.Cohttp_lwt_unix.IO)

    Module Cohttp_lwt_unix.IO

    • deprecated This module is not for public consumption

    The Io module contains the IO implementation for cohttp-lwt-unix.

    The Logs source name for this module logger is "cohttp.lwt.io". Refer to the Debug module for further details.

    include Cohttp_lwt.S.IO with type ic = Cohttp_lwt_unix__.Input_channel.t and type oc = Lwt_io.output_channel and type conn = Conduit_lwt_unix.flow diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Net/IO/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Net/IO/index.html index 8f8cff9ac..9dd84af78 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Net/IO/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Net/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-lwt-unix.Cohttp_lwt_unix.Net.IO)

    Module Net.IO

    The Io module contains the IO implementation for cohttp-lwt-unix.

    The Logs source name for this module logger is "cohttp.lwt.io". Refer to the Debug module for further details.

    include Cohttp_lwt.S.IO +IO (cohttp-lwt-unix.Cohttp_lwt_unix.Net.IO)

    Module Net.IO

    The Io module contains the IO implementation for cohttp-lwt-unix.

    The Logs source name for this module logger is "cohttp.lwt.io". Refer to the Debug module for further details.

    include Cohttp_lwt.S.IO with type ic = Cohttp_lwt_unix__.Input_channel.t and type oc = Lwt_io.output_channel and type conn = Conduit_lwt_unix.flow diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Net/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Net/index.html index 16dc1eb6d..6b502d752 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Net/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Net/index.html @@ -1,5 +1,5 @@ -Net (cohttp-lwt-unix.Cohttp_lwt_unix.Net)

    Module Cohttp_lwt_unix.Net

    Basic satisfaction of Cohttp_lwt.Net

    type ctx = {
    1. ctx : Conduit_lwt_unix.ctx;
    2. resolver : Resolver_lwt.t;
    }
    include Cohttp_lwt.S.Net +Net (cohttp-lwt-unix.Cohttp_lwt_unix.Net)

    Module Cohttp_lwt_unix.Net

    Basic satisfaction of Cohttp_lwt.Net

    type ctx = {
    1. ctx : Conduit_lwt_unix.ctx;
    2. resolver : Resolver_lwt.t;
    }
    include Cohttp_lwt.S.Net with module IO = Cohttp_lwt_unix__.Io and type ctx := ctx - and type endp = Conduit.endp
    module IO : sig ... end

    The Io module contains the IO implementation for cohttp-lwt-unix.

    type endp = Conduit.endp
    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    val init : ?ctx:Conduit_lwt_unix.ctx -> ?resolver:Resolver_lwt.t -> unit -> ctx

    init ?ctx ?resolver () is a network context that is the same as the default_ctx, but with either the connection handling or resolution module overridden with ctx or resolver respectively. This is useful to supply a Conduit_lwt_unix.resolver with a custom source network interface, or a Resolver_lwt.t with a different name resolution strategy (for instance to override a hostname to point it to a Unix domain socket).

    + and type endp = Conduit.endp
    module IO : sig ... end

    The Io module contains the IO implementation for cohttp-lwt-unix.

    type endp = Conduit.endp
    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx Stdlib.Lazy.t
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    val init : ?ctx:Conduit_lwt_unix.ctx -> ?resolver:Resolver_lwt.t -> unit -> ctx

    init ?ctx ?resolver () is a network context that is the same as the default_ctx, but with either the connection handling or resolution module overridden with ctx or resolver respectively. This is useful to supply a Conduit_lwt_unix.resolver with a custom source network interface, or a Resolver_lwt.t with a different name resolution strategy (for instance to override a hostname to point it to a Unix domain socket).

    diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Private/IO/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Private/IO/index.html index 6a5ae1a3b..5f4519e2b 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Private/IO/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Private/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-lwt-unix.Cohttp_lwt_unix.Private.IO)

    Module Private.IO

    The Io module contains the IO implementation for cohttp-lwt-unix.

    The Logs source name for this module logger is "cohttp.lwt.io". Refer to the Debug module for further details.

    include Cohttp_lwt.S.IO +IO (cohttp-lwt-unix.Cohttp_lwt_unix.Private.IO)

    Module Private.IO

    The Io module contains the IO implementation for cohttp-lwt-unix.

    The Logs source name for this module logger is "cohttp.lwt.io". Refer to the Debug module for further details.

    include Cohttp_lwt.S.IO with type ic = Cohttp_lwt_unix__.Input_channel.t and type oc = Lwt_io.output_channel and type conn = Conduit_lwt_unix.flow diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Private/Input_channel/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Private/Input_channel/index.html index 7c4065c0e..8f9251e61 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Private/Input_channel/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Private/Input_channel/index.html @@ -1,2 +1,2 @@ -Input_channel (cohttp-lwt-unix.Cohttp_lwt_unix.Private.Input_channel)

    Module Private.Input_channel

    module Bytebuffer = Cohttp_lwt.Private.Bytebuffer
    type t = {
    1. buf : Bytebuffer.t;
    2. chan : Lwt_io.input_channel;
    }
    val create : ?buf_len:int -> Lwt_io.input_channel -> t
    val read_line_opt : t -> string option Lwt.t
    val read : t -> int -> string Lwt.t
    val refill : t -> [ `Eof | `Ok ] Lwt.t
    val with_input_buffer : t -> f:(string -> pos:int -> len:int -> 'a * int) -> 'b
    val close : t -> unit Lwt.t
    +Input_channel (cohttp-lwt-unix.Cohttp_lwt_unix.Private.Input_channel)

    Module Private.Input_channel

    module Bytebuffer = Cohttp_lwt.Private.Bytebuffer
    type t = {
    1. buf : Bytebuffer.t;
    2. chan : Lwt_io.input_channel;
    }
    val create : ?buf_len:int -> Lwt_io.input_channel -> t
    val read_line_opt : t -> string option Lwt.t
    val read : t -> int -> string Lwt.t
    val refill : t -> [ `Eof | `Ok ] Lwt.t
    val with_input_buffer : t -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val close : t -> unit Lwt.t
    diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Private/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Private/index.html index 132990aa8..78cc74b08 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Private/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Private/index.html @@ -1,2 +1,2 @@ -Private (cohttp-lwt-unix.Cohttp_lwt_unix.Private)

    Module Cohttp_lwt_unix.Private

    module Input_channel : sig ... end
    module IO : sig ... end

    The Io module contains the IO implementation for cohttp-lwt-unix.

    +Private (cohttp-lwt-unix.Cohttp_lwt_unix.Private)

    Module Cohttp_lwt_unix.Private

    module Input_channel : sig ... end
    module IO : sig ... end

    The Io module contains the IO implementation for cohttp-lwt-unix.

    diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Request/IO/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Request/IO/index.html index 63b8c2195..a3958a05b 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Request/IO/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Request/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-lwt-unix.Cohttp_lwt_unix.Request.IO)

    Module Request.IO

    type 'a t = 'a Lwt.t
    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
    val return : 'a -> 'a t
    type ic
    type oc = Lwt_io.output_channel
    type conn = Conduit_lwt_unix.flow
    val refill : ic -> [ `Eof | `Ok ] t
    val with_input_buffer : +IO (cohttp-lwt-unix.Cohttp_lwt_unix.Request.IO)

    Module Request.IO

    type 'a t = 'a Lwt.t
    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
    val return : 'a -> 'a t
    type ic
    type oc = Lwt_io.output_channel
    type conn = Conduit_lwt_unix.flow
    val refill : ic -> [ `Eof | `Ok ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t
    val read : ic -> int -> string t
    val write : oc -> string -> unit t
    val flush : oc -> unit t
    diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Request/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Request/index.html index 3f12309ca..9357c7fc3 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Request/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Request/index.html @@ -1,5 +1,5 @@ -Request (cohttp-lwt-unix.Cohttp_lwt_unix.Request)

    Module Cohttp_lwt_unix.Request

    include module type of struct include Cohttp.Request end

    This contains the metadata for a HTTP/1.x request header, including the headers, version, meth and uri. The body is handled by the separate S module type, as it is dependent on the IO implementation.

    The interface exposes a fieldslib interface which provides individual accessor functions for each of the records below. It also provides sexp serializers to convert to-and-from an Core.Std.Sexp.t.

    include Cohttp.S.Request with type t = Http.Request.t
    type t = Http.Request.t = {
    1. headers : Cohttp.Header.t;
      (*

      HTTP request headers

      *)
    2. meth : Cohttp.Code.meth;
      (*

      HTTP request method

      *)
    3. scheme : string option;
      (*

      URI scheme (http or https)

      *)
    4. resource : string;
      (*

      Request path and query

      *)
    5. version : Cohttp.Code.version;
      (*

      HTTP version, usually 1.1

      *)
    6. encoding : Cohttp.Transfer.encoding;
      (*
      • deprecated this field will be removed in the future
      *)
    }
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val headers : t -> Cohttp.Header.t
    val meth : t -> Cohttp.Code.meth
    val scheme : t -> string option
    val resource : t -> string
    val version : t -> Cohttp.Code.version
    val encoding : t -> Cohttp.Transfer.encoding
    val compare : t -> t -> int
    val make : +Request (cohttp-lwt-unix.Cohttp_lwt_unix.Request)

    Module Cohttp_lwt_unix.Request

    include module type of struct include Cohttp.Request end

    This contains the metadata for a HTTP/1.x request header, including the headers, version, meth and uri. The body is handled by the separate S module type, as it is dependent on the IO implementation.

    The interface exposes a fieldslib interface which provides individual accessor functions for each of the records below. It also provides sexp serializers to convert to-and-from an Core.Std.Sexp.t.

    include Cohttp.S.Request with type t = Http.Request.t
    type t = Http.Request.t = {
    1. headers : Cohttp.Header.t;
      (*

      HTTP request headers

      *)
    2. meth : Cohttp.Code.meth;
      (*

      HTTP request method

      *)
    3. resource : string;
      (*

      Request path and query

      *)
    4. version : Cohttp.Code.version;
      (*

      HTTP version, usually 1.1

      *)
    }
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val headers : t -> Cohttp.Header.t
    val meth : t -> Cohttp.Code.meth
    val resource : t -> string
    val version : t -> Cohttp.Code.version
    val encoding : t -> Cohttp.Transfer.encoding
    val compare : t -> t -> int
    val make : ?meth:Cohttp.Code.meth -> ?version:Cohttp.Code.version -> ?encoding:Cohttp.Transfer.encoding -> @@ -11,4 +11,4 @@ ?body_length:int64 -> Cohttp.Code.meth -> Uri.t -> - t
    val has_body : t -> [ `No | `Unknown | `Yes ]
    val pp_hum : Stdlib.Format.formatter -> t -> unit

    Human-readable output, used by the toplevel printer

    module Make = Cohttp.Request.Make
    module Private = Cohttp.Request.Private
    include sig ... end
    type reader
    type writer
    module IO : sig ... end
    val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of t ] IO.t
    val make_body_writer : ?flush:bool -> t -> IO.oc -> writer
    val make_body_reader : t -> IO.ic -> reader
    val read_body_chunk : reader -> Cohttp.Transfer.chunk IO.t
    val write_header : t -> IO.oc -> unit IO.t
    val write_body : writer -> string -> unit IO.t
    val write : ?flush:bool -> (writer -> unit IO.t) -> t -> IO.oc -> unit IO.t
    + t
    val has_body : t -> [ `No | `Unknown | `Yes ]
    val pp_hum : Stdlib.Format.formatter -> t -> unit

    Human-readable output, used by the toplevel printer

    module Make = Cohttp.Request.Make
    module Private = Cohttp.Request.Private
    include sig ... end
    type reader
    type writer
    module IO : sig ... end
    val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of t ] IO.t
    val make_body_writer : flush:bool -> t -> IO.oc -> writer
    val make_body_reader : t -> IO.ic -> reader
    val read_body_chunk : reader -> Cohttp.Transfer.chunk IO.t
    val write_header : t -> IO.oc -> unit IO.t
    val write_body : writer -> string -> unit IO.t
    val write : flush:bool -> (writer -> unit IO.t) -> t -> IO.oc -> unit IO.t
    diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Response/IO/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Response/IO/index.html index dcd90b316..df924927c 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Response/IO/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Response/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-lwt-unix.Cohttp_lwt_unix.Response.IO)

    Module Response.IO

    type 'a t = 'a Lwt.t
    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
    val return : 'a -> 'a t
    type ic
    type oc = Lwt_io.output_channel
    type conn = Conduit_lwt_unix.flow
    val refill : ic -> [ `Eof | `Ok ] t
    val with_input_buffer : +IO (cohttp-lwt-unix.Cohttp_lwt_unix.Response.IO)

    Module Response.IO

    type 'a t = 'a Lwt.t
    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
    val return : 'a -> 'a t
    type ic
    type oc = Lwt_io.output_channel
    type conn = Conduit_lwt_unix.flow
    val refill : ic -> [ `Eof | `Ok ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t
    val read : ic -> int -> string t
    val write : oc -> string -> unit t
    val flush : oc -> unit t
    diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Response/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Response/index.html index 6d7cc8b2c..acf9bba87 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Response/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Response/index.html @@ -1,9 +1,8 @@ -Response (cohttp-lwt-unix.Cohttp_lwt_unix.Response)

    Module Cohttp_lwt_unix.Response

    include module type of struct include Cohttp.Response end

    This contains the metadata for a HTTP/1.1 response header, including the encoding, headers, version, status code and whether to flush the connection after every body chunk (useful for server-side events and other long-lived connection protocols). The body is handled by the separate S module type, as it is dependent on the IO implementation.

    The interface exposes a fieldslib interface which provides individual accessor functions for each of the records below. It also provides sexp serializers to convert to-and-from an Core.Std.Sexp.t.

    include Cohttp.S.Response with type t = Http.Response.t
    type t = Http.Response.t = {
    1. encoding : Cohttp.Transfer.encoding;
      (*
      • deprecated this field will be removed in the future
      *)
    2. headers : Cohttp.Header.t;
      (*

      response HTTP headers

      *)
    3. version : Cohttp.Code.version;
      (*

      (** HTTP version, usually 1.1 *)

      *)
    4. status : Cohttp.Code.status_code;
      (*

      HTTP status code of the response

      *)
    5. flush : bool;
      (*
      • deprecated this field will be removed in the future
      *)
    }
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val encoding : t -> Cohttp.Transfer.encoding
    val headers : t -> Cohttp.Header.t
    val version : t -> Cohttp.Code.version
    val status : t -> Cohttp.Code.status_code
    val flush : t -> bool
    val compare : t -> t -> int
    val make : +Response (cohttp-lwt-unix.Cohttp_lwt_unix.Response)

    Module Cohttp_lwt_unix.Response

    include module type of struct include Cohttp.Response end

    This contains the metadata for a HTTP/1.1 response header, including the encoding, headers, version, status code and whether to flush the connection after every body chunk (useful for server-side events and other long-lived connection protocols). The body is handled by the separate S module type, as it is dependent on the IO implementation.

    The interface exposes a fieldslib interface which provides individual accessor functions for each of the records below. It also provides sexp serializers to convert to-and-from an Core.Std.Sexp.t.

    include Cohttp.S.Response with type t = Http.Response.t
    type t = Http.Response.t = {
    1. headers : Cohttp.Header.t;
      (*

      response HTTP headers

      *)
    2. version : Cohttp.Code.version;
      (*

      (** HTTP version, usually 1.1 *)

      *)
    3. status : Cohttp.Code.status_code;
      (*

      HTTP status code of the response

      *)
    }
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val encoding : t -> Cohttp.Transfer.encoding
    val headers : t -> Cohttp.Header.t
    val version : t -> Cohttp.Code.version
    val status : t -> Cohttp.Code.status_code
    val compare : t -> t -> int
    val make : ?version:Cohttp.Code.version -> ?status:Cohttp.Code.status_code -> - ?flush:bool -> ?encoding:Cohttp.Transfer.encoding -> ?headers:Cohttp.Header.t -> unit -> - t

    make () is a value of t. The default values for the request, if not specified, are: status is `Ok, version is `HTTP_1_1, flush is false and headers is Header.empty. The request encoding value is determined via the Header.get_transfer_encoding function and, if not found, uses the default value Transfer.Chunked.

    val has_body : t -> [ `No | `Unknown | `Yes ]
    val pp_hum : Stdlib.Format.formatter -> t -> unit

    Human-readable output, used by the toplevel printer

    module Make = Cohttp.Response.Make
    module Private = Cohttp.Response.Private
    include sig ... end
    type reader
    type writer
    module IO : sig ... end
    val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of t ] IO.t
    val make_body_writer : ?flush:bool -> t -> IO.oc -> writer
    val make_body_reader : t -> IO.ic -> reader
    val read_body_chunk : reader -> Cohttp.Transfer.chunk IO.t
    val write_header : t -> IO.oc -> unit IO.t
    val write_body : writer -> string -> unit IO.t
    val write : ?flush:bool -> (writer -> unit IO.t) -> t -> IO.oc -> unit IO.t
    + t

    make () is a value of t. The default values for the request, if not specified, are: status is `Ok, version is `HTTP_1_1, flush is false and headers is Header.empty. The request encoding value is determined via the Header.get_transfer_encoding function and, if not found, uses the default value Transfer.Chunked.

    val has_body : t -> [ `No | `Unknown | `Yes ]
    val pp_hum : Stdlib.Format.formatter -> t -> unit

    Human-readable output, used by the toplevel printer

    module Make = Cohttp.Response.Make
    module Private = Cohttp.Response.Private
    include sig ... end
    type reader
    type writer
    module IO : sig ... end
    val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of t ] IO.t
    val make_body_writer : flush:bool -> t -> IO.oc -> writer
    val make_body_reader : t -> IO.ic -> reader
    val read_body_chunk : reader -> Cohttp.Transfer.chunk IO.t
    val write_header : t -> IO.oc -> unit IO.t
    val write_body : writer -> string -> unit IO.t
    val write : flush:bool -> (writer -> unit IO.t) -> t -> IO.oc -> unit IO.t
    diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Server/IO/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Server/IO/index.html index 8fb542ae5..d9722da23 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Server/IO/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Server/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-lwt-unix.Cohttp_lwt_unix.Server.IO)

    Module Server.IO

    The Io module contains the IO implementation for cohttp-lwt-unix.

    The Logs source name for this module logger is "cohttp.lwt.io". Refer to the Debug module for further details.

    include Cohttp_lwt.S.IO +IO (cohttp-lwt-unix.Cohttp_lwt_unix.Server.IO)

    Module Server.IO

    The Io module contains the IO implementation for cohttp-lwt-unix.

    The Logs source name for this module logger is "cohttp.lwt.io". Refer to the Debug module for further details.

    include Cohttp_lwt.S.IO with type ic = Cohttp_lwt_unix__.Input_channel.t and type oc = Lwt_io.output_channel and type conn = Conduit_lwt_unix.flow diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/Server/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/Server/index.html index 5ac58860a..1c16d18d1 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/Server/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/Server/index.html @@ -1,7 +1,8 @@ -Server (cohttp-lwt-unix.Cohttp_lwt_unix.Server)

    Module Cohttp_lwt_unix.Server

    The Server module implements the full UNIX HTTP server interface, including the UNIX-specific functions defined in S.

    The Logs source name for this module logger is "cohttp.lwt.server". Refer to the Debug module for further details.

    include Cohttp_lwt.S.Server with module IO = Cohttp_lwt_unix__.Io
    module IO : sig ... end

    The Io module contains the IO implementation for cohttp-lwt-unix.

    include Cohttp.Generic.Server.S +Server (cohttp-lwt-unix.Cohttp_lwt_unix.Server)

    Module Cohttp_lwt_unix.Server

    The Server module implements the full UNIX HTTP server interface, including the UNIX-specific functions defined in S.

    The Logs source name for this module logger is "cohttp.lwt.server". Refer to the Debug module for further details.

    include Cohttp_lwt.S.Server with module IO = Cohttp_lwt_unix__.Io
    module IO : sig ... end

    The Io module contains the IO implementation for cohttp-lwt-unix.

    include Cohttp.Generic.Server.S with type body = Cohttp_lwt.Body.t - and module IO := IO
    type body = Cohttp_lwt.Body.t
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of Http.Response.t * body
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unitIO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : + and module IO := IO + and type response = Http.Response.t * Cohttp_lwt.Body.t
    type body = Cohttp_lwt.Body.t
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of response
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unit IO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : ?conn_closed:(conn -> unit) -> callback:(conn -> Http.Request.t -> body -> response_action IO.t) -> unit -> @@ -15,21 +16,19 @@ unit -> t
    val make : ?conn_closed:(conn -> unit) -> - callback:(conn -> Http.Request.t -> body -> (Http.Response.t * body) IO.t) -> + callback:(conn -> Http.Request.t -> body -> response IO.t) -> unit -> t
    val respond : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> body:body -> unit -> - (Http.Response.t * body) IO.t

    respond ?headers ?flush ~status ~body will respond to an HTTP request with the given status code and response body. If flush is true, then every response chunk will be flushed to the network rather than being buffered. flush is true by default. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : + response IO.t

    respond ?headers ~status ~body will respond to an HTTP request with the given status code and response body. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> body:string -> unit -> - (Http.Response.t * body) IO.t
    val callback : t -> IO.conn -> IO.ic -> IO.oc -> unit IO.t
    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve a URI and a docroot into a concrete local filename.

    • deprecated Please use Cohttp.Path.resolve_local_file.
    val respond_error : + response IO.t
    val callback : t -> IO.conn -> IO.ic -> IO.oc -> unit IO.t
    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve a URI and a docroot into a concrete local filename.

    • deprecated Please use Cohttp.Path.resolve_local_file.
    val respond_error : ?headers:Http.Header.t -> ?status:Http.Status.t -> body:string -> diff --git a/cohttp-lwt-unix/Cohttp_lwt_unix/index.html b/cohttp-lwt-unix/Cohttp_lwt_unix/index.html index 40c4d6532..78e3de543 100644 --- a/cohttp-lwt-unix/Cohttp_lwt_unix/index.html +++ b/cohttp-lwt-unix/Cohttp_lwt_unix/index.html @@ -1,2 +1,2 @@ -Cohttp_lwt_unix (cohttp-lwt-unix.Cohttp_lwt_unix)

    Module Cohttp_lwt_unix

    module Request : sig ... end
    module Response : sig ... end
    module Connection : sig ... end
    module Connection_cache : sig ... end
    module Client : sig ... end

    The Client module implements the full UNIX HTTP client interface, including the UNIX-specific functions defined in C.

    module Server : sig ... end

    The Server module implements the full UNIX HTTP server interface, including the UNIX-specific functions defined in S.

    module Debug : sig ... end

    Debugging output for Cohttp Unix

    module Net : sig ... end

    Basic satisfaction of Cohttp_lwt.Net

    module IO : sig ... end
    module Private : sig ... end
    +Cohttp_lwt_unix (cohttp-lwt-unix.Cohttp_lwt_unix)

    Module Cohttp_lwt_unix

    module Request : sig ... end
    module Response : sig ... end
    module Connection : sig ... end
    module Connection_cache : sig ... end
    module Client : sig ... end

    The Client module implements the full UNIX HTTP client interface, including the UNIX-specific functions defined in C.

    module Server : sig ... end

    The Server module implements the full UNIX HTTP server interface, including the UNIX-specific functions defined in S.

    module Debug : sig ... end

    Debugging output for Cohttp Unix

    module Net : sig ... end

    Basic satisfaction of Cohttp_lwt.Net

    module IO : sig ... end
    module Private : sig ... end
    diff --git a/cohttp-lwt-unix/index.html b/cohttp-lwt-unix/index.html index 876b6dbfc..84500a9c1 100644 --- a/cohttp-lwt-unix/index.html +++ b/cohttp-lwt-unix/index.html @@ -1,2 +1,2 @@ -index (cohttp-lwt-unix.index)

    cohttp-lwt-unix index

    Library cohttp-lwt-unix

    The entry point of this library is the module: Cohttp_lwt_unix.

    +index (cohttp-lwt-unix.index)

    cohttp-lwt-unix index

    Library cohttp-lwt-unix

    The entry point of this library is the module: Cohttp_lwt_unix.

    diff --git a/cohttp-lwt/Cohttp_lwt/Body/index.html b/cohttp-lwt/Cohttp_lwt/Body/index.html index ae96bfca8..f18dab573 100644 --- a/cohttp-lwt/Cohttp_lwt/Body/index.html +++ b/cohttp-lwt/Cohttp_lwt/Body/index.html @@ -1,5 +1,5 @@ -Body (cohttp-lwt.Cohttp_lwt.Body)

    Module Cohttp_lwt.Body

    type t = [
    1. | Cohttp.Body.t
    2. | `Stream of string Lwt_stream.t
    ]
    val sexp_of_t : t -> Sexplib0.Sexp.t
    val t_of_sexp : Sexplib0.Sexp.t -> t
    val __t_of_sexp__ : Sexplib0.Sexp.t -> t
    include Cohttp.S.Body with type t := t
    val empty : t
    val of_string : string -> t
    val of_string_list : string list -> t
    val of_form : ?scheme:string -> (string * string list) list -> t
    val map : (string -> string) -> t -> t
    val transfer_encoding : t -> Cohttp.Transfer.encoding
    val is_empty : t -> bool Lwt.t
    val to_string : t -> string Lwt.t
    val to_string_list : t -> string list Lwt.t
    val to_stream : t -> string Lwt_stream.t
    val of_stream : string Lwt_stream.t -> t
    val to_form : t -> (string * string list) list Lwt.t
    val create_stream : +Body (cohttp-lwt.Cohttp_lwt.Body)

    Module Cohttp_lwt.Body

    type t = [
    1. | Cohttp.Body.t
    2. | `Stream of string Lwt_stream.t
    ]
    val sexp_of_t : t -> Sexplib0.Sexp.t
    val t_of_sexp : Sexplib0.Sexp.t -> t
    val __t_of_sexp__ : Sexplib0.Sexp.t -> t
    include Cohttp.S.Body with type t := t
    val empty : t
    val of_string : string -> t
    val of_string_list : string list -> t
    val of_form : ?scheme:string -> (string * string list) list -> t
    val map : (string -> string) -> t -> t
    val transfer_encoding : t -> Cohttp.Transfer.encoding
    val is_empty : t -> bool Lwt.t
    val to_string : t -> string Lwt.t
    val to_string_list : t -> string list Lwt.t
    val to_stream : t -> string Lwt_stream.t
    val of_stream : string Lwt_stream.t -> t
    val to_form : t -> (string * string list) list Lwt.t
    val create_stream : ('a -> Cohttp.Transfer.chunk Lwt.t) -> 'a -> string Lwt_stream.t
    val length : t -> (int64 * t) Lwt.t
    val write_body : (string -> unit Lwt.t) -> t -> unit Lwt.t
    val drain_body : t -> unit Lwt.t
    diff --git a/cohttp-lwt/Cohttp_lwt/Client/Make/argument-1-Connection/Net/IO/index.html b/cohttp-lwt/Cohttp_lwt/Client/Make/argument-1-Connection/Net/IO/index.html index 821983f2e..a9b52d44c 100644 --- a/cohttp-lwt/Cohttp_lwt/Client/Make/argument-1-Connection/Net/IO/index.html +++ b/cohttp-lwt/Cohttp_lwt/Client/Make/argument-1-Connection/Net/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-lwt.Cohttp_lwt.Client.Make.Connection.Net.IO)

    Module Net.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-lwt.Cohttp_lwt.Client.Make.Connection.Net.IO)

    Module Net.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    type error
    val catch : (unit -> 'a t) -> ('a, error) Stdlib.result t

    catch f is f () >|= Result.ok, unless f fails with an IO error, in which case it returns the error.

    val pp_error : Stdlib.Format.formatter -> error -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/Client/Make/argument-1-Connection/Net/index.html b/cohttp-lwt/Cohttp_lwt/Client/Make/argument-1-Connection/Net/index.html index a16241083..e1c68be69 100644 --- a/cohttp-lwt/Cohttp_lwt/Client/Make/argument-1-Connection/Net/index.html +++ b/cohttp-lwt/Cohttp_lwt/Client/Make/argument-1-Connection/Net/index.html @@ -1,2 +1,2 @@ -Net (cohttp-lwt.Cohttp_lwt.Client.Make.Connection.Net)

    Module Connection.Net

    module IO : S.IO
    type endp
    type ctx

    Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.

    Depending on ctx, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, ctx might initiate a secured connection with TLS (using ocaml-tls) or SSL (using ocaml-ssl), on *:443 or on the specified port by the user. If neitehr ocaml-tls or ocaml-ssl are installed on the system, cohttp/conduit tries the usual (*:80) or the specified port by the user in a non-secured way.

    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    +Net (cohttp-lwt.Cohttp_lwt.Client.Make.Connection.Net)

    Module Connection.Net

    module IO : S.IO
    type endp
    type ctx

    Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.

    Depending on ctx, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, ctx might initiate a secured connection with TLS (using ocaml-tls) or SSL (using ocaml-ssl), on *:443 or on the specified port by the user. If neitehr ocaml-tls or ocaml-ssl are installed on the system, cohttp/conduit tries the usual (*:80) or the specified port by the user in a non-secured way.

    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx Stdlib.Lazy.t
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/Client/Make/argument-1-Connection/index.html b/cohttp-lwt/Cohttp_lwt/Client/Make/argument-1-Connection/index.html index 59a895fe6..58d25c5a7 100644 --- a/cohttp-lwt/Cohttp_lwt/Client/Make/argument-1-Connection/index.html +++ b/cohttp-lwt/Cohttp_lwt/Client/Make/argument-1-Connection/index.html @@ -1,10 +1,10 @@ -Connection (cohttp-lwt.Cohttp_lwt.Client.Make.Connection)

    Parameter Make.Connection

    module Net : S.Net
    exception Retry
    type t
    val create : +Connection (cohttp-lwt.Cohttp_lwt.Client.Make.Connection)

    Parameter Make.Connection

    module Net : S.Net
    exception Retry
    type t
    val create : ?finalise:(t -> unit Net.IO.t) -> ?persistent:bool -> ?ctx:Net.ctx -> Net.endp -> - t

    create ?finalise ?persistent ?ctx endp connects to endp. The connection handle may be used immediately, although the connection may not yet be established.

    • parameter finalise

      called when the connection is closed, but before still waiting requests are failed.

    • parameter persistent

      if false, a Connection: close header is sent and the connection closed as soon as possible. If true, it is assumed the remote end does support pipelining and multiple requests may be sent even before receiving any reply. By default we wait for the first response to decide whether connection keep-alive and pipelining is suppored. Chunked encoding can only be used when pipelining is supported. Therefore better avoid using chunked encoding on the very first request.

    • parameter ctx

      See Net.ctx

    • parameter endp

      The remote address, port and protocol to connect to.

    val connect : + t

    create ?finalise ?persistent ?ctx endp connects to endp. The connection handle may be used immediately, although the connection may not yet be established.

    • parameter finalise

      called when the connection is closed, but before still waiting requests are failed.

    • parameter persistent

      if false, a Connection: close header is sent and the connection closed as soon as possible. If true, it is assumed the remote end does support pipelining and multiple requests may be sent even before receiving any reply. By default we wait for the first response to decide whether connection keep-alive and pipelining is supported. Chunked encoding can only be used when pipelining is supported. Therefore better avoid using chunked encoding on the very first request.

    • parameter ctx

      See Net.ctx

    • parameter endp

      The remote address, port and protocol to connect to.

    val connect : ?finalise:(t -> unit Net.IO.t) -> ?persistent:bool -> ?ctx:Net.ctx -> diff --git a/cohttp-lwt/Cohttp_lwt/Client/Make/index.html b/cohttp-lwt/Cohttp_lwt/Client/Make/index.html index 0f50980dd..775249da7 100644 --- a/cohttp-lwt/Cohttp_lwt/Client/Make/index.html +++ b/cohttp-lwt/Cohttp_lwt/Client/Make/index.html @@ -1,5 +1,5 @@ -Make (cohttp-lwt.Cohttp_lwt.Client.Make)

    Module Client.Make

    Parameters

    Signature

    • parameter ctx

      If provided, no connection cache is used, but Connection_cache.Make_no_cache.create is used to resolve uri and create a dedicated connection with ctx.

      In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.

    include Cohttp.Generic.Client.S +Make (cohttp-lwt.Cohttp_lwt.Client.Make)

    Module Client.Make

    Parameters

    Signature

    • parameter ctx

      If provided, no connection cache is used, but Connection_cache.Make_no_cache.create is used to resolve uri and create a dedicated connection with ctx.

      In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.

    include Cohttp.Generic.Client.S with type 'a io = 'a Lwt.t and type body = Body.t and type 'a with_context = ?ctx:ctx -> 'a
    type 'a io = 'a Lwt.t
    type 'a with_context = ?ctx:ctx -> 'a
    type body = Body.t
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : @@ -43,4 +43,4 @@ ?ctx:ctx -> Uri.t -> (Http.Request.t * Body.t) Lwt_stream.t -> - (Http.Response.t * Body.t) Lwt_stream.t Lwt.t
    • deprecated

      use moduleCohttp_lwt.Connection instead.

    + (Http.Response.t * Body.t) Lwt_stream.t Lwt.t
    diff --git a/cohttp-lwt/Cohttp_lwt/Client/index.html b/cohttp-lwt/Cohttp_lwt/Client/index.html index 112fec959..6dac82d2e 100644 --- a/cohttp-lwt/Cohttp_lwt/Client/index.html +++ b/cohttp-lwt/Cohttp_lwt/Client/index.html @@ -1,4 +1,4 @@ -Client (cohttp-lwt.Cohttp_lwt.Client)

    Module Cohttp_lwt.Client

    The Make functor glues together a Cohttp.S.IO implementation to send requests down a connection that is established by the Net module. The resulting module satisfies the Client module type.

    The Logs source name for this module's logger is "cohttp.lwt.client". When logging is enabled (at least warning level), eventual body leaks will be logged and easier to track.

    module Make +Client (cohttp-lwt.Cohttp_lwt.Client)

    Module Cohttp_lwt.Client

    The Make functor glues together a Cohttp.S.IO implementation to send requests down a connection that is established by the Net module. The resulting module satisfies the Client module type.

    The Logs source name for this module's logger is "cohttp.lwt.client". When logging is enabled (at least warning level), eventual body leaks will be logged and easier to track.

    diff --git a/cohttp-lwt/Cohttp_lwt/Connection/Make/argument-1-Net/IO/index.html b/cohttp-lwt/Cohttp_lwt/Connection/Make/argument-1-Net/IO/index.html index 438e50111..6866f6370 100644 --- a/cohttp-lwt/Cohttp_lwt/Connection/Make/argument-1-Net/IO/index.html +++ b/cohttp-lwt/Cohttp_lwt/Connection/Make/argument-1-Net/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-lwt.Cohttp_lwt.Connection.Make.Net.IO)

    Module Net.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-lwt.Cohttp_lwt.Connection.Make.Net.IO)

    Module Net.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    type error
    val catch : (unit -> 'a t) -> ('a, error) Stdlib.result t

    catch f is f () >|= Result.ok, unless f fails with an IO error, in which case it returns the error.

    val pp_error : Stdlib.Format.formatter -> error -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/Connection/Make/argument-1-Net/index.html b/cohttp-lwt/Cohttp_lwt/Connection/Make/argument-1-Net/index.html index 6101b8d21..051abcfa0 100644 --- a/cohttp-lwt/Cohttp_lwt/Connection/Make/argument-1-Net/index.html +++ b/cohttp-lwt/Cohttp_lwt/Connection/Make/argument-1-Net/index.html @@ -1,2 +1,2 @@ -Net (cohttp-lwt.Cohttp_lwt.Connection.Make.Net)

    Parameter Make.Net

    module IO : S.IO
    type endp
    type ctx

    Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.

    Depending on ctx, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, ctx might initiate a secured connection with TLS (using ocaml-tls) or SSL (using ocaml-ssl), on *:443 or on the specified port by the user. If neitehr ocaml-tls or ocaml-ssl are installed on the system, cohttp/conduit tries the usual (*:80) or the specified port by the user in a non-secured way.

    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    +Net (cohttp-lwt.Cohttp_lwt.Connection.Make.Net)

    Parameter Make.Net

    module IO : S.IO
    type endp
    type ctx

    Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.

    Depending on ctx, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, ctx might initiate a secured connection with TLS (using ocaml-tls) or SSL (using ocaml-ssl), on *:443 or on the specified port by the user. If neitehr ocaml-tls or ocaml-ssl are installed on the system, cohttp/conduit tries the usual (*:80) or the specified port by the user in a non-secured way.

    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx Stdlib.Lazy.t
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/Connection/Make/index.html b/cohttp-lwt/Cohttp_lwt/Connection/Make/index.html index 336dfba42..a6467c6bd 100644 --- a/cohttp-lwt/Cohttp_lwt/Connection/Make/index.html +++ b/cohttp-lwt/Cohttp_lwt/Connection/Make/index.html @@ -1,10 +1,10 @@ -Make (cohttp-lwt.Cohttp_lwt.Connection.Make)

    Module Connection.Make

    Parameters

    module Net : S.Net

    Signature

    module Net = Net
    exception Retry
    type t
    val create : +Make (cohttp-lwt.Cohttp_lwt.Connection.Make)

    Module Connection.Make

    Parameters

    module Net : S.Net

    Signature

    module Net = Net
    exception Retry
    type t
    val create : ?finalise:(t -> unit Net.IO.t) -> ?persistent:bool -> ?ctx:Net.ctx -> Net.endp -> - t

    create ?finalise ?persistent ?ctx endp connects to endp. The connection handle may be used immediately, although the connection may not yet be established.

    • parameter finalise

      called when the connection is closed, but before still waiting requests are failed.

    • parameter persistent

      if false, a Connection: close header is sent and the connection closed as soon as possible. If true, it is assumed the remote end does support pipelining and multiple requests may be sent even before receiving any reply. By default we wait for the first response to decide whether connection keep-alive and pipelining is suppored. Chunked encoding can only be used when pipelining is supported. Therefore better avoid using chunked encoding on the very first request.

    • parameter ctx

      See Net.ctx

    • parameter endp

      The remote address, port and protocol to connect to.

    val connect : + t

    create ?finalise ?persistent ?ctx endp connects to endp. The connection handle may be used immediately, although the connection may not yet be established.

    • parameter finalise

      called when the connection is closed, but before still waiting requests are failed.

    • parameter persistent

      if false, a Connection: close header is sent and the connection closed as soon as possible. If true, it is assumed the remote end does support pipelining and multiple requests may be sent even before receiving any reply. By default we wait for the first response to decide whether connection keep-alive and pipelining is supported. Chunked encoding can only be used when pipelining is supported. Therefore better avoid using chunked encoding on the very first request.

    • parameter ctx

      See Net.ctx

    • parameter endp

      The remote address, port and protocol to connect to.

    val connect : ?finalise:(t -> unit Net.IO.t) -> ?persistent:bool -> ?ctx:Net.ctx -> diff --git a/cohttp-lwt/Cohttp_lwt/Connection/index.html b/cohttp-lwt/Cohttp_lwt/Connection/index.html index 5c827746a..e5a0ac058 100644 --- a/cohttp-lwt/Cohttp_lwt/Connection/index.html +++ b/cohttp-lwt/Cohttp_lwt/Connection/index.html @@ -1,2 +1,2 @@ -Connection (cohttp-lwt.Cohttp_lwt.Connection)

    Module Cohttp_lwt.Connection

    exception Retry

    Raised on failed requests that may be safely retried - even on non-idempotent requests. Raised for example on timeout or connection suhtdown by remote end.

    module Make (Net : S.Net) : S.Connection with module Net = Net
    +Connection (cohttp-lwt.Cohttp_lwt.Connection)

    Module Cohttp_lwt.Connection

    exception Retry

    Raised on failed requests that may be safely retried - even on non-idempotent requests. Raised for example on timeout or connection suhtdown by remote end.

    module Make (Net : S.Net) : S.Connection with module Net = Net
    diff --git a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/argument-1-Connection/Net/IO/index.html b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/argument-1-Connection/Net/IO/index.html index b3e58eda2..4d27f419e 100644 --- a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/argument-1-Connection/Net/IO/index.html +++ b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/argument-1-Connection/Net/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-lwt.Cohttp_lwt.Connection_cache.Make.Connection.Net.IO)

    Module Net.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-lwt.Cohttp_lwt.Connection_cache.Make.Connection.Net.IO)

    Module Net.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    type error
    val catch : (unit -> 'a t) -> ('a, error) Stdlib.result t

    catch f is f () >|= Result.ok, unless f fails with an IO error, in which case it returns the error.

    val pp_error : Stdlib.Format.formatter -> error -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/argument-1-Connection/Net/index.html b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/argument-1-Connection/Net/index.html index 5da4f16ba..dd3756409 100644 --- a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/argument-1-Connection/Net/index.html +++ b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/argument-1-Connection/Net/index.html @@ -1,2 +1,2 @@ -Net (cohttp-lwt.Cohttp_lwt.Connection_cache.Make.Connection.Net)

    Module Connection.Net

    module IO : S.IO
    type endp
    type ctx

    Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.

    Depending on ctx, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, ctx might initiate a secured connection with TLS (using ocaml-tls) or SSL (using ocaml-ssl), on *:443 or on the specified port by the user. If neitehr ocaml-tls or ocaml-ssl are installed on the system, cohttp/conduit tries the usual (*:80) or the specified port by the user in a non-secured way.

    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    +Net (cohttp-lwt.Cohttp_lwt.Connection_cache.Make.Connection.Net)

    Module Connection.Net

    module IO : S.IO
    type endp
    type ctx

    Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.

    Depending on ctx, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, ctx might initiate a secured connection with TLS (using ocaml-tls) or SSL (using ocaml-ssl), on *:443 or on the specified port by the user. If neitehr ocaml-tls or ocaml-ssl are installed on the system, cohttp/conduit tries the usual (*:80) or the specified port by the user in a non-secured way.

    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx Stdlib.Lazy.t
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/argument-1-Connection/index.html b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/argument-1-Connection/index.html index a3a19fbd6..7cc3ba043 100644 --- a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/argument-1-Connection/index.html +++ b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/argument-1-Connection/index.html @@ -1,10 +1,10 @@ -Connection (cohttp-lwt.Cohttp_lwt.Connection_cache.Make.Connection)

    Parameter Make.Connection

    module Net : S.Net
    exception Retry
    type t
    val create : +Connection (cohttp-lwt.Cohttp_lwt.Connection_cache.Make.Connection)

    Parameter Make.Connection

    module Net : S.Net
    exception Retry
    type t
    val create : ?finalise:(t -> unit Net.IO.t) -> ?persistent:bool -> ?ctx:Net.ctx -> Net.endp -> - t

    create ?finalise ?persistent ?ctx endp connects to endp. The connection handle may be used immediately, although the connection may not yet be established.

    • parameter finalise

      called when the connection is closed, but before still waiting requests are failed.

    • parameter persistent

      if false, a Connection: close header is sent and the connection closed as soon as possible. If true, it is assumed the remote end does support pipelining and multiple requests may be sent even before receiving any reply. By default we wait for the first response to decide whether connection keep-alive and pipelining is suppored. Chunked encoding can only be used when pipelining is supported. Therefore better avoid using chunked encoding on the very first request.

    • parameter ctx

      See Net.ctx

    • parameter endp

      The remote address, port and protocol to connect to.

    val connect : + t

    create ?finalise ?persistent ?ctx endp connects to endp. The connection handle may be used immediately, although the connection may not yet be established.

    • parameter finalise

      called when the connection is closed, but before still waiting requests are failed.

    • parameter persistent

      if false, a Connection: close header is sent and the connection closed as soon as possible. If true, it is assumed the remote end does support pipelining and multiple requests may be sent even before receiving any reply. By default we wait for the first response to decide whether connection keep-alive and pipelining is supported. Chunked encoding can only be used when pipelining is supported. Therefore better avoid using chunked encoding on the very first request.

    • parameter ctx

      See Net.ctx

    • parameter endp

      The remote address, port and protocol to connect to.

    val connect : ?finalise:(t -> unit Net.IO.t) -> ?persistent:bool -> ?ctx:Net.ctx -> diff --git a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/argument-2-Sleep/index.html b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/argument-2-Sleep/index.html index 62220d969..475a96236 100644 --- a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/argument-2-Sleep/index.html +++ b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/argument-2-Sleep/index.html @@ -1,2 +1,2 @@ -Sleep (cohttp-lwt.Cohttp_lwt.Connection_cache.Make.Sleep)

    Parameter Make.Sleep

    val sleep_ns : int64 -> unit Lwt.t
    +Sleep (cohttp-lwt.Cohttp_lwt.Connection_cache.Make.Sleep)

    Parameter Make.Sleep

    val sleep_ns : int64 -> unit Lwt.t
    diff --git a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/index.html b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/index.html index 02f1445ed..5e373d108 100644 --- a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/index.html +++ b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make/index.html @@ -1,5 +1,5 @@ -Make (cohttp-lwt.Cohttp_lwt.Connection_cache.Make)

    Module Connection_cache.Make

    This functor keeps a cache of connecions for reuse. Connections are reused based on their remote Conduit.endp (effectively IP / port).

    Parameters

    module Sleep : S.Sleep

    Signature

    include S.Connection_cache
    type t
    val call : t -> S.call

    Process a request. Please see call.

    val create : +Make (cohttp-lwt.Cohttp_lwt.Connection_cache.Make)

    Module Connection_cache.Make

    This functor keeps a cache of connections for reuse. Connections are reused based on their remote Conduit.endp (effectively IP / port).

    Parameters

    module Sleep : S.Sleep

    Signature

    include S.Connection_cache
    type t
    val call : t -> S.call

    Process a request. Please see call.

    val create : ?ctx:Connection.Net.ctx -> ?keep:int64 -> ?retry:int -> diff --git a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make_no_cache/argument-1-Connection/Net/IO/index.html b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make_no_cache/argument-1-Connection/Net/IO/index.html index 1f16a4653..54268f217 100644 --- a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make_no_cache/argument-1-Connection/Net/IO/index.html +++ b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make_no_cache/argument-1-Connection/Net/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-lwt.Cohttp_lwt.Connection_cache.Make_no_cache.Connection.Net.IO)

    Module Net.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-lwt.Cohttp_lwt.Connection_cache.Make_no_cache.Connection.Net.IO)

    Module Net.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    type error
    val catch : (unit -> 'a t) -> ('a, error) Stdlib.result t

    catch f is f () >|= Result.ok, unless f fails with an IO error, in which case it returns the error.

    val pp_error : Stdlib.Format.formatter -> error -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make_no_cache/argument-1-Connection/Net/index.html b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make_no_cache/argument-1-Connection/Net/index.html index e4dcdbaac..6b1ee376a 100644 --- a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make_no_cache/argument-1-Connection/Net/index.html +++ b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make_no_cache/argument-1-Connection/Net/index.html @@ -1,2 +1,2 @@ -Net (cohttp-lwt.Cohttp_lwt.Connection_cache.Make_no_cache.Connection.Net)

    Module Connection.Net

    module IO : S.IO
    type endp
    type ctx

    Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.

    Depending on ctx, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, ctx might initiate a secured connection with TLS (using ocaml-tls) or SSL (using ocaml-ssl), on *:443 or on the specified port by the user. If neitehr ocaml-tls or ocaml-ssl are installed on the system, cohttp/conduit tries the usual (*:80) or the specified port by the user in a non-secured way.

    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    +Net (cohttp-lwt.Cohttp_lwt.Connection_cache.Make_no_cache.Connection.Net)

    Module Connection.Net

    module IO : S.IO
    type endp
    type ctx

    Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.

    Depending on ctx, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, ctx might initiate a secured connection with TLS (using ocaml-tls) or SSL (using ocaml-ssl), on *:443 or on the specified port by the user. If neitehr ocaml-tls or ocaml-ssl are installed on the system, cohttp/conduit tries the usual (*:80) or the specified port by the user in a non-secured way.

    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx Stdlib.Lazy.t
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make_no_cache/argument-1-Connection/index.html b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make_no_cache/argument-1-Connection/index.html index b8640cf24..506894b3e 100644 --- a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make_no_cache/argument-1-Connection/index.html +++ b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make_no_cache/argument-1-Connection/index.html @@ -1,10 +1,10 @@ -Connection (cohttp-lwt.Cohttp_lwt.Connection_cache.Make_no_cache.Connection)

    Parameter Make_no_cache.Connection

    module Net : S.Net
    exception Retry
    type t
    val create : +Connection (cohttp-lwt.Cohttp_lwt.Connection_cache.Make_no_cache.Connection)

    Parameter Make_no_cache.Connection

    module Net : S.Net
    exception Retry
    type t
    val create : ?finalise:(t -> unit Net.IO.t) -> ?persistent:bool -> ?ctx:Net.ctx -> Net.endp -> - t

    create ?finalise ?persistent ?ctx endp connects to endp. The connection handle may be used immediately, although the connection may not yet be established.

    • parameter finalise

      called when the connection is closed, but before still waiting requests are failed.

    • parameter persistent

      if false, a Connection: close header is sent and the connection closed as soon as possible. If true, it is assumed the remote end does support pipelining and multiple requests may be sent even before receiving any reply. By default we wait for the first response to decide whether connection keep-alive and pipelining is suppored. Chunked encoding can only be used when pipelining is supported. Therefore better avoid using chunked encoding on the very first request.

    • parameter ctx

      See Net.ctx

    • parameter endp

      The remote address, port and protocol to connect to.

    val connect : + t

    create ?finalise ?persistent ?ctx endp connects to endp. The connection handle may be used immediately, although the connection may not yet be established.

    • parameter finalise

      called when the connection is closed, but before still waiting requests are failed.

    • parameter persistent

      if false, a Connection: close header is sent and the connection closed as soon as possible. If true, it is assumed the remote end does support pipelining and multiple requests may be sent even before receiving any reply. By default we wait for the first response to decide whether connection keep-alive and pipelining is supported. Chunked encoding can only be used when pipelining is supported. Therefore better avoid using chunked encoding on the very first request.

    • parameter ctx

      See Net.ctx

    • parameter endp

      The remote address, port and protocol to connect to.

    val connect : ?finalise:(t -> unit Net.IO.t) -> ?persistent:bool -> ?ctx:Net.ctx -> diff --git a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make_no_cache/index.html b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make_no_cache/index.html index 9dd7f5cb7..b5858b389 100644 --- a/cohttp-lwt/Cohttp_lwt/Connection_cache/Make_no_cache/index.html +++ b/cohttp-lwt/Cohttp_lwt/Connection_cache/Make_no_cache/index.html @@ -1,2 +1,2 @@ -Make_no_cache (cohttp-lwt.Cohttp_lwt.Connection_cache.Make_no_cache)

    Module Connection_cache.Make_no_cache

    This functor establishes a new connection for each request.

    Parameters

    Signature

    include S.Connection_cache
    type t
    val call : t -> S.call

    Process a request. Please see call.

    val create : ?ctx:Connection.Net.ctx -> unit -> t

    create ?ctx () creates a connection for handling a single request. The connection accepts only a single request and will automatically be closed as soon as possible.

    • parameter ctx

      See

      onnection.Net.ctx

    +Make_no_cache (cohttp-lwt.Cohttp_lwt.Connection_cache.Make_no_cache)

    Module Connection_cache.Make_no_cache

    This functor establishes a new connection for each request.

    Parameters

    Signature

    include S.Connection_cache
    type t
    val call : t -> S.call

    Process a request. Please see call.

    val create : ?ctx:Connection.Net.ctx -> unit -> t

    create ?ctx () creates a connection for handling a single request. The connection accepts only a single request and will automatically be closed as soon as possible.

    diff --git a/cohttp-lwt/Cohttp_lwt/Connection_cache/index.html b/cohttp-lwt/Cohttp_lwt/Connection_cache/index.html index d9310633a..d12d4a025 100644 --- a/cohttp-lwt/Cohttp_lwt/Connection_cache/index.html +++ b/cohttp-lwt/Cohttp_lwt/Connection_cache/index.html @@ -1,2 +1,2 @@ -Connection_cache (cohttp-lwt.Cohttp_lwt.Connection_cache)

    Module Cohttp_lwt.Connection_cache

    exception Retry
    module Make_no_cache (Connection : S.Connection) : sig ... end

    This functor establishes a new connection for each request.

    module Make (Connection : S.Connection) (Sleep : S.Sleep) : sig ... end

    This functor keeps a cache of connecions for reuse. Connections are reused based on their remote Conduit.endp (effectively IP / port).

    +Connection_cache (cohttp-lwt.Cohttp_lwt.Connection_cache)

    Module Cohttp_lwt.Connection_cache

    exception Retry
    module Make_no_cache (Connection : S.Connection) : sig ... end

    This functor establishes a new connection for each request.

    module Make (Connection : S.Connection) (Sleep : S.Sleep) : sig ... end

    This functor keeps a cache of connections for reuse. Connections are reused based on their remote Conduit.endp (effectively IP / port).

    diff --git a/cohttp-lwt/Cohttp_lwt/Make_client/argument-1-IO/index.html b/cohttp-lwt/Cohttp_lwt/Make_client/argument-1-IO/index.html index 0a289e1be..1a057594d 100644 --- a/cohttp-lwt/Cohttp_lwt/Make_client/argument-1-IO/index.html +++ b/cohttp-lwt/Cohttp_lwt/Make_client/argument-1-IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-lwt.Cohttp_lwt.Make_client.IO)

    Parameter Make_client.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-lwt.Cohttp_lwt.Make_client.IO)

    Parameter Make_client.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    type error
    val catch : (unit -> 'a t) -> ('a, error) Stdlib.result t

    catch f is f () >|= Result.ok, unless f fails with an IO error, in which case it returns the error.

    val pp_error : Stdlib.Format.formatter -> error -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/Make_client/argument-2-Net/index.html b/cohttp-lwt/Cohttp_lwt/Make_client/argument-2-Net/index.html index 1f960921b..239d073ae 100644 --- a/cohttp-lwt/Cohttp_lwt/Make_client/argument-2-Net/index.html +++ b/cohttp-lwt/Cohttp_lwt/Make_client/argument-2-Net/index.html @@ -1,2 +1,2 @@ -Net (cohttp-lwt.Cohttp_lwt.Make_client.Net)

    Parameter Make_client.Net

    module IO = IO
    type endp
    type ctx

    Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.

    Depending on ctx, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, ctx might initiate a secured connection with TLS (using ocaml-tls) or SSL (using ocaml-ssl), on *:443 or on the specified port by the user. If neitehr ocaml-tls or ocaml-ssl are installed on the system, cohttp/conduit tries the usual (*:80) or the specified port by the user in a non-secured way.

    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    +Net (cohttp-lwt.Cohttp_lwt.Make_client.Net)

    Parameter Make_client.Net

    module IO = IO
    type endp
    type ctx

    Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.

    Depending on ctx, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, ctx might initiate a secured connection with TLS (using ocaml-tls) or SSL (using ocaml-ssl), on *:443 or on the specified port by the user. If neitehr ocaml-tls or ocaml-ssl are installed on the system, cohttp/conduit tries the usual (*:80) or the specified port by the user in a non-secured way.

    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx Stdlib.Lazy.t
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/Make_client/index.html b/cohttp-lwt/Cohttp_lwt/Make_client/index.html index cc756d39f..ca28bc55a 100644 --- a/cohttp-lwt/Cohttp_lwt/Make_client/index.html +++ b/cohttp-lwt/Cohttp_lwt/Make_client/index.html @@ -1,5 +1,5 @@ -Make_client (cohttp-lwt.Cohttp_lwt.Make_client)

    Module Cohttp_lwt.Make_client

    Parameters

    module IO : IO
    module Net : S.Net with module IO = IO

    Signature

    type 'a io = 'a Lwt.t
    type !'a with_context = ?ctx:ctx -> 'a
    type body = Body.t
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : +Make_client (cohttp-lwt.Cohttp_lwt.Make_client)

    Module Cohttp_lwt.Make_client

    Parameters

    module IO : IO
    module Net : S.Net with module IO = IO

    Signature

    type 'a io = 'a Lwt.t
    type !'a with_context = ?ctx:ctx -> 'a
    type body = Body.t
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : (?headers:Http.Header.t -> ?body:body -> ?chunked:bool -> diff --git a/cohttp-lwt/Cohttp_lwt/Private/Bytebuffer/index.html b/cohttp-lwt/Cohttp_lwt/Private/Bytebuffer/index.html index 1c5242068..5c3aeebf3 100644 --- a/cohttp-lwt/Cohttp_lwt/Private/Bytebuffer/index.html +++ b/cohttp-lwt/Cohttp_lwt/Private/Bytebuffer/index.html @@ -1,5 +1,5 @@ -Bytebuffer (cohttp-lwt.Cohttp_lwt.Private.Bytebuffer)

    Module Private.Bytebuffer

    include module type of struct include Http_bytebuffer.Bytebuffer end
    val create : int -> t
    val unsafe_buf : t -> Stdlib.Bytes.t
    val pos : t -> int
    val compact : t -> unit
    val length : t -> int
    val drop : t -> int -> unit
    val to_string : t -> string
    include sig ... end
    val refill : +Bytebuffer (cohttp-lwt.Cohttp_lwt.Private.Bytebuffer)

    Module Private.Bytebuffer

    include module type of struct include Http_bytebuffer.Bytebuffer end
    val create : int -> t
    val unsafe_buf : t -> Stdlib.Bytes.t
    val pos : t -> int
    val compact : t -> unit
    val length : t -> int
    val drop : t -> int -> unit
    val to_string : t -> string
    include sig ... end
    val refill : Http_bytebuffer__Bytebuffer.t -> (bytes -> pos:int -> len:int -> [ `Eof | `Ok of int ] Lwt.t) -> [ `Eof | `Ok ] Lwt.t
    val read_line : diff --git a/cohttp-lwt/Cohttp_lwt/Private/String_io/index.html b/cohttp-lwt/Cohttp_lwt/Private/String_io/index.html index e4dbdab06..1f1801255 100644 --- a/cohttp-lwt/Cohttp_lwt/Private/String_io/index.html +++ b/cohttp-lwt/Cohttp_lwt/Private/String_io/index.html @@ -1,5 +1,5 @@ -String_io (cohttp-lwt.Cohttp_lwt.Private.String_io)

    Module Private.String_io

    Lwt IO implementation that uses strings to marshal and unmarshal HTTP

    IO interface that uses buf for input data and queues output data into a Buffer.t. Never actually blocks despite the Lwt use, although a future revision may yield when parsing large strings.

    include Cohttp.S.IO +String_io (cohttp-lwt.Cohttp_lwt.Private.String_io)

    Module Private.String_io

    Lwt IO implementation that uses strings to marshal and unmarshal HTTP

    IO interface that uses Cohttp.Private.String_io.buf for input data and queues output data into a Buffer.t. Never actually blocks despite the Lwt use, although a future revision may yield when parsing large strings.

    include Cohttp.S.IO with type 'a t = 'a Lwt.t and type ic = Cohttp.Private.String_io.buf and type oc = Stdlib.Buffer.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    ic represents an input channel

    type oc = Stdlib.Buffer.t

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : diff --git a/cohttp-lwt/Cohttp_lwt/Private/index.html b/cohttp-lwt/Cohttp_lwt/Private/index.html index 3ff183789..374a12a6e 100644 --- a/cohttp-lwt/Cohttp_lwt/Private/index.html +++ b/cohttp-lwt/Cohttp_lwt/Private/index.html @@ -1,2 +1,2 @@ -Private (cohttp-lwt.Cohttp_lwt.Private)

    Module Cohttp_lwt.Private

    module Bytebuffer : sig ... end
    module String_io : sig ... end

    Lwt IO implementation that uses strings to marshal and unmarshal HTTP

    +Private (cohttp-lwt.Cohttp_lwt.Private)

    Module Cohttp_lwt.Private

    module Bytebuffer : sig ... end
    module String_io : sig ... end

    Lwt IO implementation that uses strings to marshal and unmarshal HTTP

    diff --git a/cohttp-lwt/Cohttp_lwt/S/index.html b/cohttp-lwt/Cohttp_lwt/S/index.html index 0e6a2b620..6f39d2b95 100644 --- a/cohttp-lwt/Cohttp_lwt/S/index.html +++ b/cohttp-lwt/Cohttp_lwt/S/index.html @@ -1,8 +1,8 @@ -S (cohttp-lwt.Cohttp_lwt.S)

    Module Cohttp_lwt.S

    Portable Lwt implementation of HTTP client and server, without depending on a particular I/O implementation. The various Make functors must be instantiated by an implementation that provides a concrete IO monad.

    module type IO = sig ... end

    The IO module is specialized for the Lwt monad.

    module type Net = sig ... end

    The Net module type defines how to connect to a remote node and close the resulting channels to clean up.

    module type Sleep = sig ... end

    This is compatible with Mirage_time.S. It may be satisfied by mirage-time-unix Time or Mirage_time.

    type call = +S (cohttp-lwt.Cohttp_lwt.S)

    Module Cohttp_lwt.S

    Portable Lwt implementation of HTTP client and server, without depending on a particular I/O implementation. The various Make functors must be instantiated by an implementation that provides a concrete IO monad.

    module type IO = sig ... end

    The IO module is specialized for the Lwt monad.

    module type Net = sig ... end

    The Net module type defines how to connect to a remote node and close the resulting channels to clean up.

    module type Sleep = sig ... end

    This is compatible with Mirage_time.S. It may be satisfied by mirage-time-unix Time or Mirage_time.

    type call = ?headers:Http.Header.t -> ?body:Body.t -> Http.Method.t -> Uri.t -> (Cohttp.Response.t * Body.t) Lwt.t

    call ?headers ?body method uri Function type used to handle http requests

    • returns

      (response, response_body) response_body is not buffered, but stays on the wire until consumed. It must therefore be consumed in a timely manner. Otherwise the connection would stay open and a file descriptor leak may be caused. Following responses would get blocked. Functions in the Body module can be used to consume response_body. Use Body.drain_body if you don't consume the body by other means.

      Leaks are detected by the GC and logged as debug messages, these can be enabled activating the debug logging. For example, this can be done as follows in cohttp-lwt-unix

      Cohttp_lwt_unix.Debug.activate_debug ();
      -Logs.set_level (Some Logs.Warning)
    • raises {!exception

      Connection.Retry

    }

    on recoverable errors like the remote endpoint closing the connection gracefully. Even non-idempotent requests are guaranteed to not have been processed by the remote endpoint and should be retried. But beware that a `Stream body may have been consumed.

    module type Connection = sig ... end

    The Connection module handles a single, possibly pipelined, http connection.

    module type Connection_cache = sig ... end

    A Connection_cache handles http requests. It not necessarily caches connections.

    module type Client = sig ... end

    The Client module is a collection of convenience functions for constructing and processing requests.

    module type Server = sig ... end

    The Server module implements a pipelined HTTP/1.1 server.

    +Logs.set_level (Some Logs.Warning)
    • raises {!Connection.Retry}

      on recoverable errors like the remote endpoint closing the connection gracefully. Even non-idempotent requests are guaranteed to not have been processed by the remote endpoint and should be retried. But beware that a `Stream body may have been consumed.

    module type Connection = sig ... end

    The Connection module handles a single, possibly pipelined, http connection.

    module type Connection_cache = sig ... end

    A Connection_cache handles http requests. It not necessarily caches connections.

    module type Client = sig ... end

    The Client module is a collection of convenience functions for constructing and processing requests.

    module type Server = sig ... end

    The Server module implements a pipelined HTTP/1.1 server.

    diff --git a/cohttp-lwt/Cohttp_lwt/S/module-type-Client/index.html b/cohttp-lwt/Cohttp_lwt/S/module-type-Client/index.html index bb315252c..27921d49e 100644 --- a/cohttp-lwt/Cohttp_lwt/S/module-type-Client/index.html +++ b/cohttp-lwt/Cohttp_lwt/S/module-type-Client/index.html @@ -1,5 +1,5 @@ -Client (cohttp-lwt.Cohttp_lwt.S.Client)

    Module type S.Client

    The Client module is a collection of convenience functions for constructing and processing requests.

    type ctx
    • parameter ctx

      If provided, no connection cache is used, but Connection_cache.Make_no_cache.create is used to resolve uri and create a dedicated connection with ctx.

      In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.

    include Cohttp.Generic.Client.S +Client (cohttp-lwt.Cohttp_lwt.S.Client)

    Module type S.Client

    The Client module is a collection of convenience functions for constructing and processing requests.

    type ctx
    • parameter ctx

      If provided, no connection cache is used, but Connection_cache.Make_no_cache.create is used to resolve uri and create a dedicated connection with ctx.

      In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.

    include Cohttp.Generic.Client.S with type 'a io = 'a Lwt.t and type body = Body.t and type 'a with_context = ?ctx:ctx -> 'a
    type 'a io = 'a Lwt.t
    type 'a with_context = ?ctx:ctx -> 'a
    type body = Body.t
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : @@ -43,4 +43,4 @@ ?ctx:ctx -> Uri.t -> (Http.Request.t * Body.t) Lwt_stream.t -> - (Http.Response.t * Body.t) Lwt_stream.t Lwt.t
    • deprecated

      use moduleCohttp_lwt.Connection instead.

    + (Http.Response.t * Body.t) Lwt_stream.t Lwt.t
    diff --git a/cohttp-lwt/Cohttp_lwt/S/module-type-Connection/Net/IO/index.html b/cohttp-lwt/Cohttp_lwt/S/module-type-Connection/Net/IO/index.html index b37777b29..6264771e6 100644 --- a/cohttp-lwt/Cohttp_lwt/S/module-type-Connection/Net/IO/index.html +++ b/cohttp-lwt/Cohttp_lwt/S/module-type-Connection/Net/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-lwt.Cohttp_lwt.S.Connection.Net.IO)

    Module Net.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-lwt.Cohttp_lwt.S.Connection.Net.IO)

    Module Net.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    type error
    val catch : (unit -> 'a t) -> ('a, error) Stdlib.result t

    catch f is f () >|= Result.ok, unless f fails with an IO error, in which case it returns the error.

    val pp_error : Stdlib.Format.formatter -> error -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/S/module-type-Connection/Net/index.html b/cohttp-lwt/Cohttp_lwt/S/module-type-Connection/Net/index.html index 1b17dc84c..3c25b3a1b 100644 --- a/cohttp-lwt/Cohttp_lwt/S/module-type-Connection/Net/index.html +++ b/cohttp-lwt/Cohttp_lwt/S/module-type-Connection/Net/index.html @@ -1,2 +1,2 @@ -Net (cohttp-lwt.Cohttp_lwt.S.Connection.Net)

    Module Connection.Net

    module IO : IO
    type endp
    type ctx

    Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.

    Depending on ctx, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, ctx might initiate a secured connection with TLS (using ocaml-tls) or SSL (using ocaml-ssl), on *:443 or on the specified port by the user. If neitehr ocaml-tls or ocaml-ssl are installed on the system, cohttp/conduit tries the usual (*:80) or the specified port by the user in a non-secured way.

    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    +Net (cohttp-lwt.Cohttp_lwt.S.Connection.Net)

    Module Connection.Net

    module IO : IO
    type endp
    type ctx

    Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.

    Depending on ctx, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, ctx might initiate a secured connection with TLS (using ocaml-tls) or SSL (using ocaml-ssl), on *:443 or on the specified port by the user. If neitehr ocaml-tls or ocaml-ssl are installed on the system, cohttp/conduit tries the usual (*:80) or the specified port by the user in a non-secured way.

    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx Stdlib.Lazy.t
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/S/module-type-Connection/index.html b/cohttp-lwt/Cohttp_lwt/S/module-type-Connection/index.html index da941b72b..11df36724 100644 --- a/cohttp-lwt/Cohttp_lwt/S/module-type-Connection/index.html +++ b/cohttp-lwt/Cohttp_lwt/S/module-type-Connection/index.html @@ -1,10 +1,10 @@ -Connection (cohttp-lwt.Cohttp_lwt.S.Connection)

    Module type S.Connection

    The Connection module handles a single, possibly pipelined, http connection.

    module Net : Net
    exception Retry
    type t
    val create : +Connection (cohttp-lwt.Cohttp_lwt.S.Connection)

    Module type S.Connection

    The Connection module handles a single, possibly pipelined, http connection.

    module Net : Net
    exception Retry
    type t
    val create : ?finalise:(t -> unit Net.IO.t) -> ?persistent:bool -> ?ctx:Net.ctx -> Net.endp -> - t

    create ?finalise ?persistent ?ctx endp connects to endp. The connection handle may be used immediately, although the connection may not yet be established.

    • parameter finalise

      called when the connection is closed, but before still waiting requests are failed.

    • parameter persistent

      if false, a Connection: close header is sent and the connection closed as soon as possible. If true, it is assumed the remote end does support pipelining and multiple requests may be sent even before receiving any reply. By default we wait for the first response to decide whether connection keep-alive and pipelining is suppored. Chunked encoding can only be used when pipelining is supported. Therefore better avoid using chunked encoding on the very first request.

    • parameter ctx

      See Net.ctx

    • parameter endp

      The remote address, port and protocol to connect to.

    val connect : + t

    create ?finalise ?persistent ?ctx endp connects to endp. The connection handle may be used immediately, although the connection may not yet be established.

    • parameter finalise

      called when the connection is closed, but before still waiting requests are failed.

    • parameter persistent

      if false, a Connection: close header is sent and the connection closed as soon as possible. If true, it is assumed the remote end does support pipelining and multiple requests may be sent even before receiving any reply. By default we wait for the first response to decide whether connection keep-alive and pipelining is supported. Chunked encoding can only be used when pipelining is supported. Therefore better avoid using chunked encoding on the very first request.

    • parameter ctx

      See Net.ctx

    • parameter endp

      The remote address, port and protocol to connect to.

    val connect : ?finalise:(t -> unit Net.IO.t) -> ?persistent:bool -> ?ctx:Net.ctx -> diff --git a/cohttp-lwt/Cohttp_lwt/S/module-type-Connection_cache/index.html b/cohttp-lwt/Cohttp_lwt/S/module-type-Connection_cache/index.html index be95bc341..0b0f94ea3 100644 --- a/cohttp-lwt/Cohttp_lwt/S/module-type-Connection_cache/index.html +++ b/cohttp-lwt/Cohttp_lwt/S/module-type-Connection_cache/index.html @@ -1,2 +1,2 @@ -Connection_cache (cohttp-lwt.Cohttp_lwt.S.Connection_cache)

    Module type S.Connection_cache

    A Connection_cache handles http requests. It not necessarily caches connections.

    type t
    val call : t -> call

    Process a request. Please see call.

    +Connection_cache (cohttp-lwt.Cohttp_lwt.S.Connection_cache)

    Module type S.Connection_cache

    A Connection_cache handles http requests. It not necessarily caches connections.

    type t
    val call : t -> call

    Process a request. Please see call.

    diff --git a/cohttp-lwt/Cohttp_lwt/S/module-type-IO/index.html b/cohttp-lwt/Cohttp_lwt/S/module-type-IO/index.html index 7966854d0..6934ec6b8 100644 --- a/cohttp-lwt/Cohttp_lwt/S/module-type-IO/index.html +++ b/cohttp-lwt/Cohttp_lwt/S/module-type-IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-lwt.Cohttp_lwt.S.IO)

    Module type S.IO

    The IO module is specialized for the Lwt monad.

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-lwt.Cohttp_lwt.S.IO)

    Module type S.IO

    The IO module is specialized for the Lwt monad.

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    type error
    val catch : (unit -> 'a t) -> ('a, error) Stdlib.result t

    catch f is f () >|= Result.ok, unless f fails with an IO error, in which case it returns the error.

    val pp_error : Stdlib.Format.formatter -> error -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/S/module-type-Net/IO/index.html b/cohttp-lwt/Cohttp_lwt/S/module-type-Net/IO/index.html index 67da6a583..5b3d64617 100644 --- a/cohttp-lwt/Cohttp_lwt/S/module-type-Net/IO/index.html +++ b/cohttp-lwt/Cohttp_lwt/S/module-type-Net/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-lwt.Cohttp_lwt.S.Net.IO)

    Module Net.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-lwt.Cohttp_lwt.S.Net.IO)

    Module Net.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    type error
    val catch : (unit -> 'a t) -> ('a, error) Stdlib.result t

    catch f is f () >|= Result.ok, unless f fails with an IO error, in which case it returns the error.

    val pp_error : Stdlib.Format.formatter -> error -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/S/module-type-Net/index.html b/cohttp-lwt/Cohttp_lwt/S/module-type-Net/index.html index 525f5f572..ed1d403b5 100644 --- a/cohttp-lwt/Cohttp_lwt/S/module-type-Net/index.html +++ b/cohttp-lwt/Cohttp_lwt/S/module-type-Net/index.html @@ -1,2 +1,2 @@ -Net (cohttp-lwt.Cohttp_lwt.S.Net)

    Module type S.Net

    The Net module type defines how to connect to a remote node and close the resulting channels to clean up.

    module IO : IO
    type endp
    type ctx

    Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.

    Depending on ctx, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, ctx might initiate a secured connection with TLS (using ocaml-tls) or SSL (using ocaml-ssl), on *:443 or on the specified port by the user. If neitehr ocaml-tls or ocaml-ssl are installed on the system, cohttp/conduit tries the usual (*:80) or the specified port by the user in a non-secured way.

    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    +Net (cohttp-lwt.Cohttp_lwt.S.Net)

    Module type S.Net

    The Net module type defines how to connect to a remote node and close the resulting channels to clean up.

    module IO : IO
    type endp
    type ctx

    Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.

    Depending on ctx, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, ctx might initiate a secured connection with TLS (using ocaml-tls) or SSL (using ocaml-ssl), on *:443 or on the specified port by the user. If neitehr ocaml-tls or ocaml-ssl are installed on the system, cohttp/conduit tries the usual (*:80) or the specified port by the user in a non-secured way.

    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx Stdlib.Lazy.t
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/S/module-type-Server/IO/index.html b/cohttp-lwt/Cohttp_lwt/S/module-type-Server/IO/index.html index 6bb11f42e..15e09743b 100644 --- a/cohttp-lwt/Cohttp_lwt/S/module-type-Server/IO/index.html +++ b/cohttp-lwt/Cohttp_lwt/S/module-type-Server/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-lwt.Cohttp_lwt.S.Server.IO)

    Module Server.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-lwt.Cohttp_lwt.S.Server.IO)

    Module Server.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    type error
    val catch : (unit -> 'a t) -> ('a, error) Stdlib.result t

    catch f is f () >|= Result.ok, unless f fails with an IO error, in which case it returns the error.

    val pp_error : Stdlib.Format.formatter -> error -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/S/module-type-Server/index.html b/cohttp-lwt/Cohttp_lwt/S/module-type-Server/index.html index 9749aa0d6..1dcd2fb28 100644 --- a/cohttp-lwt/Cohttp_lwt/S/module-type-Server/index.html +++ b/cohttp-lwt/Cohttp_lwt/S/module-type-Server/index.html @@ -1,5 +1,8 @@ -Server (cohttp-lwt.Cohttp_lwt.S.Server)

    Module type S.Server

    The Server module implements a pipelined HTTP/1.1 server.

    module IO : IO
    include Cohttp.Generic.Server.S with type body = Body.t and module IO := IO
    type body = Body.t
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of Http.Response.t * body
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unitIO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : +Server (cohttp-lwt.Cohttp_lwt.S.Server)

    Module type S.Server

    The Server module implements a pipelined HTTP/1.1 server.

    module IO : IO
    include Cohttp.Generic.Server.S + with type body = Body.t + and module IO := IO + and type response = Http.Response.t * Body.t
    type body = Body.t
    type response = Http.Response.t * Body.t
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of response
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unit IO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : ?conn_closed:(conn -> unit) -> callback:(conn -> Http.Request.t -> body -> response_action IO.t) -> unit -> @@ -13,21 +16,19 @@ unit -> t
    val make : ?conn_closed:(conn -> unit) -> - callback:(conn -> Http.Request.t -> body -> (Http.Response.t * body) IO.t) -> + callback:(conn -> Http.Request.t -> body -> response IO.t) -> unit -> t
    val respond : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> body:body -> unit -> - (Http.Response.t * body) IO.t

    respond ?headers ?flush ~status ~body will respond to an HTTP request with the given status code and response body. If flush is true, then every response chunk will be flushed to the network rather than being buffered. flush is true by default. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : + response IO.t

    respond ?headers ~status ~body will respond to an HTTP request with the given status code and response body. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> body:string -> unit -> - (Http.Response.t * body) IO.t
    val callback : t -> IO.conn -> IO.ic -> IO.oc -> unit IO.t
    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve a URI and a docroot into a concrete local filename.

    • deprecated Please use Cohttp.Path.resolve_local_file.
    val respond_error : + response IO.t
    val callback : t -> IO.conn -> IO.ic -> IO.oc -> unit IO.t
    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve a URI and a docroot into a concrete local filename.

    • deprecated Please use Cohttp.Path.resolve_local_file.
    val respond_error : ?headers:Http.Header.t -> ?status:Http.Status.t -> body:string -> diff --git a/cohttp-lwt/Cohttp_lwt/S/module-type-Sleep/index.html b/cohttp-lwt/Cohttp_lwt/S/module-type-Sleep/index.html index 7729c363b..8d4f50664 100644 --- a/cohttp-lwt/Cohttp_lwt/S/module-type-Sleep/index.html +++ b/cohttp-lwt/Cohttp_lwt/S/module-type-Sleep/index.html @@ -1,2 +1,2 @@ -Sleep (cohttp-lwt.Cohttp_lwt.S.Sleep)

    Module type S.Sleep

    This is compatible with Mirage_time.S. It may be satisfied by mirage-time-unix Time or Mirage_time.

    val sleep_ns : int64 -> unit Lwt.t
    +Sleep (cohttp-lwt.Cohttp_lwt.S.Sleep)

    Module type S.Sleep

    This is compatible with Mirage_time.S. It may be satisfied by mirage-time-unix Time or Mirage_time.

    val sleep_ns : int64 -> unit Lwt.t
    diff --git a/cohttp-lwt/Cohttp_lwt/Server/Make/argument-1-IO/index.html b/cohttp-lwt/Cohttp_lwt/Server/Make/argument-1-IO/index.html index 455a506dc..ca635585e 100644 --- a/cohttp-lwt/Cohttp_lwt/Server/Make/argument-1-IO/index.html +++ b/cohttp-lwt/Cohttp_lwt/Server/Make/argument-1-IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-lwt.Cohttp_lwt.Server.Make.IO)

    Parameter Make.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-lwt.Cohttp_lwt.Server.Make.IO)

    Parameter Make.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    type error
    val catch : (unit -> 'a t) -> ('a, error) Stdlib.result t

    catch f is f () >|= Result.ok, unless f fails with an IO error, in which case it returns the error.

    val pp_error : Stdlib.Format.formatter -> error -> unit
    diff --git a/cohttp-lwt/Cohttp_lwt/Server/Make/index.html b/cohttp-lwt/Cohttp_lwt/Server/Make/index.html index c5786eda5..c38481c3f 100644 --- a/cohttp-lwt/Cohttp_lwt/Server/Make/index.html +++ b/cohttp-lwt/Cohttp_lwt/Server/Make/index.html @@ -1,5 +1,8 @@ -Make (cohttp-lwt.Cohttp_lwt.Server.Make)

    Module Server.Make

    Parameters

    module IO : S.IO

    Signature

    module IO = IO
    include Cohttp.Generic.Server.S with type body = Body.t and module IO := IO
    type body = Body.t
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of Http.Response.t * body
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unitIO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : +Make (cohttp-lwt.Cohttp_lwt.Server.Make)

    Module Server.Make

    Parameters

    module IO : S.IO

    Signature

    module IO = IO
    include Cohttp.Generic.Server.S + with type body = Body.t + and module IO := IO + and type response = Http.Response.t * Body.t
    type body = Body.t
    type response = Http.Response.t * Body.t
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of response
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unit IO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : ?conn_closed:(conn -> unit) -> callback:(conn -> Http.Request.t -> body -> response_action IO.t) -> unit -> @@ -13,21 +16,19 @@ unit -> t
    val make : ?conn_closed:(conn -> unit) -> - callback:(conn -> Http.Request.t -> body -> (Http.Response.t * body) IO.t) -> + callback:(conn -> Http.Request.t -> body -> response IO.t) -> unit -> t
    val respond : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> body:body -> unit -> - (Http.Response.t * body) IO.t

    respond ?headers ?flush ~status ~body will respond to an HTTP request with the given status code and response body. If flush is true, then every response chunk will be flushed to the network rather than being buffered. flush is true by default. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : + response IO.t

    respond ?headers ~status ~body will respond to an HTTP request with the given status code and response body. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> body:string -> unit -> - (Http.Response.t * body) IO.t
    val callback : t -> IO.conn -> IO.ic -> IO.oc -> unit IO.t
    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve a URI and a docroot into a concrete local filename.

    • deprecated Please use Cohttp.Path.resolve_local_file.
    val respond_error : + response IO.t
    val callback : t -> IO.conn -> IO.ic -> IO.oc -> unit IO.t
    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve a URI and a docroot into a concrete local filename.

    • deprecated Please use Cohttp.Path.resolve_local_file.
    val respond_error : ?headers:Http.Header.t -> ?status:Http.Status.t -> body:string -> diff --git a/cohttp-lwt/Cohttp_lwt/Server/index.html b/cohttp-lwt/Cohttp_lwt/Server/index.html index d7486138b..29c826f00 100644 --- a/cohttp-lwt/Cohttp_lwt/Server/index.html +++ b/cohttp-lwt/Cohttp_lwt/Server/index.html @@ -1,2 +1,2 @@ -Server (cohttp-lwt.Cohttp_lwt.Server)

    Module Cohttp_lwt.Server

    The Make functor glues together a Cohttp.S.IO implementation to send requests down a connection that is established by the user. The resulting module satisfies the Server module type.

    The Logs source name for this module's logger is "cohttp.lwt.server".

    module Make (IO : S.IO) : S.Server with module IO = IO
    +Server (cohttp-lwt.Cohttp_lwt.Server)

    Module Cohttp_lwt.Server

    The Make functor glues together a Cohttp.S.IO implementation to send requests down a connection that is established by the user. The resulting module satisfies the Server module type.

    The Logs source name for this module's logger is "cohttp.lwt.server".

    module Make (IO : S.IO) : S.Server with module IO = IO
    diff --git a/cohttp-lwt/Cohttp_lwt/index.html b/cohttp-lwt/Cohttp_lwt/index.html index e508e366b..28f9e248f 100644 --- a/cohttp-lwt/Cohttp_lwt/index.html +++ b/cohttp-lwt/Cohttp_lwt/index.html @@ -1,2 +1,2 @@ -Cohttp_lwt (cohttp-lwt.Cohttp_lwt)

    Module Cohttp_lwt

    module type IO = S.IO
    module Request = Cohttp.Request
    module Response = Cohttp.Response
    module Connection : sig ... end
    module Connection_cache : sig ... end
    module Client : sig ... end

    The Make functor glues together a Cohttp.S.IO implementation to send requests down a connection that is established by the Net module. The resulting module satisfies the Client module type.

    module Server : sig ... end

    The Make functor glues together a Cohttp.S.IO implementation to send requests down a connection that is established by the user. The resulting module satisfies the Server module type.

    module Make_client (IO : IO) (Net : S.Net with module IO = IO) : sig ... end
    module Make_server = Server.Make
    module S : sig ... end

    Portable Lwt implementation of HTTP client and server, without depending on a particular I/O implementation. The various Make functors must be instantiated by an implementation that provides a concrete IO monad.

    module Body : sig ... end
    module Private : sig ... end
    +Cohttp_lwt (cohttp-lwt.Cohttp_lwt)

    Module Cohttp_lwt

    module type IO = S.IO
    module Request = Cohttp.Request
    module Response = Cohttp.Response
    module Connection : sig ... end
    module Connection_cache : sig ... end
    module Client : sig ... end

    The Make functor glues together a Cohttp.S.IO implementation to send requests down a connection that is established by the Net module. The resulting module satisfies the Client module type.

    module Server : sig ... end

    The Make functor glues together a Cohttp.S.IO implementation to send requests down a connection that is established by the user. The resulting module satisfies the Server module type.

    module Make_client (IO : IO) (Net : S.Net with module IO = IO) : sig ... end
    module Make_server = Server.Make
    module S : sig ... end

    Portable Lwt implementation of HTTP client and server, without depending on a particular I/O implementation. The various Make functors must be instantiated by an implementation that provides a concrete IO monad.

    module Body : sig ... end
    module Private : sig ... end
    diff --git a/cohttp-lwt/index.html b/cohttp-lwt/index.html index f89c188be..4a5b7f76b 100644 --- a/cohttp-lwt/index.html +++ b/cohttp-lwt/index.html @@ -1,2 +1,2 @@ -index (cohttp-lwt.index)

    cohttp-lwt index

    Library cohttp-lwt

    The entry point of this library is the module: Cohttp_lwt.

    +index (cohttp-lwt.index)

    cohttp-lwt index

    Library cohttp-lwt

    The entry point of this library is the module: Cohttp_lwt.

    diff --git a/cohttp-mirage/Cohttp_mirage/Client/Make/Connection/Net/IO/index.html b/cohttp-mirage/Cohttp_mirage/Client/Make/Connection/Net/IO/index.html index be7562274..e35156b48 100644 --- a/cohttp-mirage/Cohttp_mirage/Client/Make/Connection/Net/IO/index.html +++ b/cohttp-mirage/Cohttp_mirage/Client/Make/Connection/Net/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-mirage.Cohttp_mirage.Client.Make.Connection.Net.IO)

    Module Net.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-mirage.Cohttp_mirage.Client.Make.Connection.Net.IO)

    Module Net.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    type error
    val catch : (unit -> 'a t) -> ('a, error) Stdlib.result t

    catch f is f () >|= Result.ok, unless f fails with an IO error, in which case it returns the error.

    val pp_error : Stdlib.Format.formatter -> error -> unit
    diff --git a/cohttp-mirage/Cohttp_mirage/Client/Make/Connection/Net/index.html b/cohttp-mirage/Cohttp_mirage/Client/Make/Connection/Net/index.html index f84e69480..c9c90a27e 100644 --- a/cohttp-mirage/Cohttp_mirage/Client/Make/Connection/Net/index.html +++ b/cohttp-mirage/Cohttp_mirage/Client/Make/Connection/Net/index.html @@ -1,2 +1,2 @@ -Net (cohttp-mirage.Cohttp_mirage.Client.Make.Connection.Net)

    Module Connection.Net

    type endp
    type ctx

    Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.

    Depending on ctx, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, ctx might initiate a secured connection with TLS (using ocaml-tls) or SSL (using ocaml-ssl), on *:443 or on the specified port by the user. If neitehr ocaml-tls or ocaml-ssl are installed on the system, cohttp/conduit tries the usual (*:80) or the specified port by the user in a non-secured way.

    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    +Net (cohttp-mirage.Cohttp_mirage.Client.Make.Connection.Net)

    Module Connection.Net

    type endp
    type ctx

    Conduit context. Contains configuration of resolver, local source address, TLS / SSL library, certificates, keys.

    Depending on ctx, the library is able to send HTTP requests unencrypted or encrypted one with a secured protocol (such as TLS). Depending on how conduit is configured, ctx might initiate a secured connection with TLS (using ocaml-tls) or SSL (using ocaml-ssl), on *:443 or on the specified port by the user. If neitehr ocaml-tls or ocaml-ssl are installed on the system, cohttp/conduit tries the usual (*:80) or the specified port by the user in a non-secured way.

    val sexp_of_ctx : ctx -> Sexplib0.Sexp.t
    val default_ctx : ctx Stdlib.Lazy.t
    val resolve : ctx:ctx -> Uri.t -> endp IO.t

    resolve ~ctx uri resolves uri into an endpoint description. This is Resolver_lwt.resolve_uri ~uri ctx.resolver.

    val connect_uri : ctx:ctx -> Uri.t -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_uri ~ctx uri starts a flow on the given uri. The choice of the protocol (with or without encryption) is done by the scheme of the given uri:

    • If the scheme is https, we will extend ctx to be able to start a TLS connection with a default TLS configuration (no authentication) on the default or user-specified port.
    • If the scheme is http, we will extend ctx to be able to start a simple TCP/IP connection on the default or user-specified port.

    These extensions have the highest priority (Conduit will try to initiate a communication with them first). By extension, we mean that the user is able to fill its own ctx and we don't overlap resolution functions from the given ctx.

    This is resolve ~ctx uri >>= connect_endp ~ctx.

    val connect_endp : ctx:ctx -> endp -> (IO.conn * IO.ic * IO.oc) IO.t

    connect_endp ~ctx endp starts a flow to the given endp. endp describes address and protocol of the endpoint to connect to.

    val close_in : IO.ic -> unit
    val close_out : IO.oc -> unit
    val close : IO.ic -> IO.oc -> unit
    diff --git a/cohttp-mirage/Cohttp_mirage/Client/Make/Connection/index.html b/cohttp-mirage/Cohttp_mirage/Client/Make/Connection/index.html index b1ce070b3..99ab5a2bf 100644 --- a/cohttp-mirage/Cohttp_mirage/Client/Make/Connection/index.html +++ b/cohttp-mirage/Cohttp_mirage/Client/Make/Connection/index.html @@ -1,10 +1,10 @@ -Connection (cohttp-mirage.Cohttp_mirage.Client.Make.Connection)

    Module Make.Connection

    exception Retry
    type t
    val create : +Connection (cohttp-mirage.Cohttp_mirage.Client.Make.Connection)

    Module Make.Connection

    exception Retry
    type t
    val create : ?finalise:(t -> unit Net.IO.t) -> ?persistent:bool -> ?ctx:Net.ctx -> Net.endp -> - t

    create ?finalise ?persistent ?ctx endp connects to endp. The connection handle may be used immediately, although the connection may not yet be established.

    • parameter finalise

      called when the connection is closed, but before still waiting requests are failed.

    • parameter persistent

      if false, a Connection: close header is sent and the connection closed as soon as possible. If true, it is assumed the remote end does support pipelining and multiple requests may be sent even before receiving any reply. By default we wait for the first response to decide whether connection keep-alive and pipelining is suppored. Chunked encoding can only be used when pipelining is supported. Therefore better avoid using chunked encoding on the very first request.

    • parameter ctx

      See Net.ctx

    • parameter endp

      The remote address, port and protocol to connect to.

    val connect : + t

    create ?finalise ?persistent ?ctx endp connects to endp. The connection handle may be used immediately, although the connection may not yet be established.

    • parameter finalise

      called when the connection is closed, but before still waiting requests are failed.

    • parameter persistent

      if false, a Connection: close header is sent and the connection closed as soon as possible. If true, it is assumed the remote end does support pipelining and multiple requests may be sent even before receiving any reply. By default we wait for the first response to decide whether connection keep-alive and pipelining is supported. Chunked encoding can only be used when pipelining is supported. Therefore better avoid using chunked encoding on the very first request.

    • parameter ctx

      See Net.ctx

    • parameter endp

      The remote address, port and protocol to connect to.

    val connect : ?finalise:(t -> unit Net.IO.t) -> ?persistent:bool -> ?ctx:Net.ctx -> diff --git a/cohttp-mirage/Cohttp_mirage/Client/Make/index.html b/cohttp-mirage/Cohttp_mirage/Client/Make/index.html index 94f8f1726..b7649151f 100644 --- a/cohttp-mirage/Cohttp_mirage/Client/Make/index.html +++ b/cohttp-mirage/Cohttp_mirage/Client/Make/index.html @@ -1,5 +1,5 @@ -Make (cohttp-mirage.Cohttp_mirage.Client.Make)

    Module Client.Make

    Parameters

    module P : Mirage_clock.PCLOCK
    module R : Resolver_mirage.S
    module S : Conduit_mirage.S

    Signature

    include Cohttp_lwt.S.Client with type ctx = Connection.Net.ctx
    • parameter ctx

      If provided, no connection cache is used, but Connection_cache.Make_no_cache.create is used to resolve uri and create a dedicated connection with ctx.

      In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.

    include Cohttp.Generic.Client.S +Make (cohttp-mirage.Cohttp_mirage.Client.Make)

    Module Client.Make

    Parameters

    module _ : Mirage_clock.PCLOCK
    module R : Resolver_mirage.S
    module S : Conduit_mirage.S

    Signature

    include Cohttp_lwt.S.Client with type ctx = Connection.Net.ctx
    • parameter ctx

      If provided, no connection cache is used, but Connection_cache.Make_no_cache.create is used to resolve uri and create a dedicated connection with ctx.

      In most cases you should use the more specific helper calls in the interface rather than invoke this function directly. See head, get and post for some examples.

    include Cohttp.Generic.Client.S with type 'a io = 'a Lwt.t and type body = Cohttp_lwt.Body.t and type 'a with_context = ?ctx:ctx -> 'a
    type 'a io = 'a Lwt.t
    type 'a with_context = ?ctx:ctx -> 'a
    type body = Cohttp_lwt.Body.t
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : @@ -43,4 +43,4 @@ ?ctx:ctx -> Uri.t -> (Http.Request.t * Cohttp_lwt.Body.t) Lwt_stream.t -> - (Http.Response.t * Cohttp_lwt.Body.t) Lwt_stream.t Lwt.t
    • deprecated

      use moduleCohttp_lwt.Connection instead.

    val ctx : ?authenticator:X509.Authenticator.t -> R.t -> S.t -> ctx
    val with_authenticator : X509.Authenticator.t -> ctx -> ctx
    + (Http.Response.t * Cohttp_lwt.Body.t) Lwt_stream.t Lwt.t
    val ctx : ?authenticator:X509.Authenticator.t -> R.t -> S.t -> ctx
    val with_authenticator : X509.Authenticator.t -> ctx -> ctx
    diff --git a/cohttp-mirage/Cohttp_mirage/Client/index.html b/cohttp-mirage/Cohttp_mirage/Client/index.html index 62bbf4fd6..3901e7316 100644 --- a/cohttp-mirage/Cohttp_mirage/Client/index.html +++ b/cohttp-mirage/Cohttp_mirage/Client/index.html @@ -1,6 +1,6 @@ -Client (cohttp-mirage.Cohttp_mirage.Client)

    Module Cohttp_mirage.Client

    module Make - (P : Mirage_clock.PCLOCK) +Client (cohttp-mirage.Cohttp_mirage.Client)

    Module Cohttp_mirage.Client

    module Make + (_ : Mirage_clock.PCLOCK) (R : Resolver_mirage.S) (S : Conduit_mirage.S) : sig ... end
    diff --git a/cohttp-mirage/Cohttp_mirage/IO/index.html b/cohttp-mirage/Cohttp_mirage/IO/index.html index 2c8d3de0f..12b6bf889 100644 --- a/cohttp-mirage/Cohttp_mirage/IO/index.html +++ b/cohttp-mirage/Cohttp_mirage/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-mirage.Cohttp_mirage.IO)

    Module Cohttp_mirage.IO

    Parameters

    module Channel : Mirage_channel.S

    Signature

    include Cohttp.S.IO +IO (cohttp-mirage.Cohttp_mirage.IO)

    Module Cohttp_mirage.IO

    Parameters

    module Channel : Mirage_channel.S

    Signature

    include Cohttp.S.IO with type 'a t = 'a Lwt.t with type ic = Cohttp_mirage__.Input_channel.Make(Channel).t with type oc = Channel.t diff --git a/cohttp-mirage/Cohttp_mirage/Server/Flow/IO/index.html b/cohttp-mirage/Cohttp_mirage/Server/Flow/IO/index.html index c30a78de2..5f459828f 100644 --- a/cohttp-mirage/Cohttp_mirage/Server/Flow/IO/index.html +++ b/cohttp-mirage/Cohttp_mirage/Server/Flow/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-mirage.Cohttp_mirage.Server.Flow.IO)

    Module Flow.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t with type conn = F.flow
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn = F.flow

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-mirage.Cohttp_mirage.Server.Flow.IO)

    Module Flow.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t with type conn = F.flow
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn = F.flow

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    type error
    val catch : (unit -> 'a t) -> ('a, error) Stdlib.result t

    catch f is f () >|= Result.ok, unless f fails with an IO error, in which case it returns the error.

    val pp_error : Stdlib.Format.formatter -> error -> unit
    diff --git a/cohttp-mirage/Cohttp_mirage/Server/Flow/index.html b/cohttp-mirage/Cohttp_mirage/Server/Flow/index.html index a1504ef56..f29011df8 100644 --- a/cohttp-mirage/Cohttp_mirage/Server/Flow/index.html +++ b/cohttp-mirage/Cohttp_mirage/Server/Flow/index.html @@ -1,7 +1,8 @@ -Flow (cohttp-mirage.Cohttp_mirage.Server.Flow)

    Module Server.Flow

    Parameters

    module F : Mirage_flow.S

    Signature

    include Cohttp_lwt.S.Server with type IO.conn = F.flow
    module IO : Cohttp_lwt.S.IO with type conn = F.flow
    include Cohttp.Generic.Server.S +Flow (cohttp-mirage.Cohttp_mirage.Server.Flow)

    Module Server.Flow

    Parameters

    module F : Mirage_flow.S

    Signature

    include Cohttp_lwt.S.Server with type IO.conn = F.flow
    module IO : Cohttp_lwt.S.IO with type conn = F.flow
    include Cohttp.Generic.Server.S with type body = Cohttp_lwt.Body.t - and module IO := IO
    type body = Cohttp_lwt.Body.t
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of Http.Response.t * body
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unitIO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : + and module IO := IO + and type response = Http.Response.t * Cohttp_lwt.Body.t
    type body = Cohttp_lwt.Body.t
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of response
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unit IO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : ?conn_closed:(conn -> unit) -> callback:(conn -> Http.Request.t -> body -> response_action IO.t) -> unit -> @@ -15,21 +16,19 @@ unit -> t
    val make : ?conn_closed:(conn -> unit) -> - callback:(conn -> Http.Request.t -> body -> (Http.Response.t * body) IO.t) -> + callback:(conn -> Http.Request.t -> body -> response IO.t) -> unit -> t
    val respond : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> body:body -> unit -> - (Http.Response.t * body) IO.t

    respond ?headers ?flush ~status ~body will respond to an HTTP request with the given status code and response body. If flush is true, then every response chunk will be flushed to the network rather than being buffered. flush is true by default. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : + response IO.t

    respond ?headers ~status ~body will respond to an HTTP request with the given status code and response body. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> body:string -> unit -> - (Http.Response.t * body) IO.t
    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve a URI and a docroot into a concrete local filename.

    • deprecated Please use Cohttp.Path.resolve_local_file.
    val respond_error : + response IO.t
    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve a URI and a docroot into a concrete local filename.

    • deprecated Please use Cohttp.Path.resolve_local_file.
    val respond_error : ?headers:Http.Header.t -> ?status:Http.Status.t -> body:string -> diff --git a/cohttp-mirage/Cohttp_mirage/Server/Make/IO/index.html b/cohttp-mirage/Cohttp_mirage/Server/Make/IO/index.html index e0b216aea..30b97cf1b 100644 --- a/cohttp-mirage/Cohttp_mirage/Server/Make/IO/index.html +++ b/cohttp-mirage/Cohttp_mirage/Server/Make/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-mirage.Cohttp_mirage.Server.Make.IO)

    Module Make.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t with type conn = S.flow
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn = S.flow

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-mirage.Cohttp_mirage.Server.Make.IO)

    Module Make.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t with type conn = S.flow
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn = S.flow

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    type error
    val catch : (unit -> 'a t) -> ('a, error) Stdlib.result t

    catch f is f () >|= Result.ok, unless f fails with an IO error, in which case it returns the error.

    val pp_error : Stdlib.Format.formatter -> error -> unit
    diff --git a/cohttp-mirage/Cohttp_mirage/Server/Make/index.html b/cohttp-mirage/Cohttp_mirage/Server/Make/index.html index 86371f1c6..55b5b37e6 100644 --- a/cohttp-mirage/Cohttp_mirage/Server/Make/index.html +++ b/cohttp-mirage/Cohttp_mirage/Server/Make/index.html @@ -1,7 +1,8 @@ -Make (cohttp-mirage.Cohttp_mirage.Server.Make)

    Module Server.Make

    Parameters

    module S : Conduit_mirage.S

    Signature

    include S with type IO.conn = S.flow
    include Cohttp_lwt.S.Server with type IO.conn = S.flow
    module IO : Cohttp_lwt.S.IO with type conn = S.flow
    include Cohttp.Generic.Server.S +Make (cohttp-mirage.Cohttp_mirage.Server.Make)

    Module Server.Make

    Parameters

    module S : Conduit_mirage.S

    Signature

    include S with type IO.conn = S.flow
    include Cohttp_lwt.S.Server with type IO.conn = S.flow
    module IO : Cohttp_lwt.S.IO with type conn = S.flow
    include Cohttp.Generic.Server.S with type body = Cohttp_lwt.Body.t - and module IO := IO
    type body = Cohttp_lwt.Body.t
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of Http.Response.t * body
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unitIO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : + and module IO := IO + and type response = Http.Response.t * Cohttp_lwt.Body.t
    type body = Cohttp_lwt.Body.t
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of response
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unit IO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : ?conn_closed:(conn -> unit) -> callback:(conn -> Http.Request.t -> body -> response_action IO.t) -> unit -> @@ -15,21 +16,19 @@ unit -> t
    val make : ?conn_closed:(conn -> unit) -> - callback:(conn -> Http.Request.t -> body -> (Http.Response.t * body) IO.t) -> + callback:(conn -> Http.Request.t -> body -> response IO.t) -> unit -> t
    val respond : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> body:body -> unit -> - (Http.Response.t * body) IO.t

    respond ?headers ?flush ~status ~body will respond to an HTTP request with the given status code and response body. If flush is true, then every response chunk will be flushed to the network rather than being buffered. flush is true by default. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : + response IO.t

    respond ?headers ~status ~body will respond to an HTTP request with the given status code and response body. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> body:string -> unit -> - (Http.Response.t * body) IO.t
    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve a URI and a docroot into a concrete local filename.

    • deprecated Please use Cohttp.Path.resolve_local_file.
    val respond_error : + response IO.t
    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve a URI and a docroot into a concrete local filename.

    • deprecated Please use Cohttp.Path.resolve_local_file.
    val respond_error : ?headers:Http.Header.t -> ?status:Http.Status.t -> body:string -> diff --git a/cohttp-mirage/Cohttp_mirage/Server/index.html b/cohttp-mirage/Cohttp_mirage/Server/index.html index ca23439b9..7cf8905ca 100644 --- a/cohttp-mirage/Cohttp_mirage/Server/index.html +++ b/cohttp-mirage/Cohttp_mirage/Server/index.html @@ -1,2 +1,2 @@ -Server (cohttp-mirage.Cohttp_mirage.Server)

    Module Cohttp_mirage.Server

    HTTP server with conduit.

    module type S = sig ... end
    module Flow (F : Mirage_flow.S) : S with type IO.conn = F.flow
    module Make (S : Conduit_mirage.S) : sig ... end
    +Server (cohttp-mirage.Cohttp_mirage.Server)

    Module Cohttp_mirage.Server

    HTTP server with conduit.

    module type S = sig ... end
    module Flow (F : Mirage_flow.S) : S with type IO.conn = F.flow
    module Make (S : Conduit_mirage.S) : sig ... end
    diff --git a/cohttp-mirage/Cohttp_mirage/Server/module-type-S/IO/index.html b/cohttp-mirage/Cohttp_mirage/Server/module-type-S/IO/index.html index 6ade92a1f..c25a8ccdc 100644 --- a/cohttp-mirage/Cohttp_mirage/Server/module-type-S/IO/index.html +++ b/cohttp-mirage/Cohttp_mirage/Server/module-type-S/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-mirage.Cohttp_mirage.Server.S.IO)

    Module S.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-mirage.Cohttp_mirage.Server.S.IO)

    Module S.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    type error
    val catch : (unit -> 'a t) -> ('a, error) Stdlib.result t

    catch f is f () >|= Result.ok, unless f fails with an IO error, in which case it returns the error.

    val pp_error : Stdlib.Format.formatter -> error -> unit
    diff --git a/cohttp-mirage/Cohttp_mirage/Server/module-type-S/index.html b/cohttp-mirage/Cohttp_mirage/Server/module-type-S/index.html index 097b080c7..d2cecb445 100644 --- a/cohttp-mirage/Cohttp_mirage/Server/module-type-S/index.html +++ b/cohttp-mirage/Cohttp_mirage/Server/module-type-S/index.html @@ -1,7 +1,8 @@ -S (cohttp-mirage.Cohttp_mirage.Server.S)

    Module type Server.S

    include Cohttp_lwt.S.Server
    include Cohttp.Generic.Server.S +S (cohttp-mirage.Cohttp_mirage.Server.S)

    Module type Server.S

    include Cohttp_lwt.S.Server
    include Cohttp.Generic.Server.S with type body = Cohttp_lwt.Body.t - and module IO := IO
    type body = Cohttp_lwt.Body.t
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of Http.Response.t * body
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unitIO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : + and module IO := IO + and type response = Http.Response.t * Cohttp_lwt.Body.t
    type body = Cohttp_lwt.Body.t
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of response
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unit IO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : ?conn_closed:(conn -> unit) -> callback:(conn -> Http.Request.t -> body -> response_action IO.t) -> unit -> @@ -15,21 +16,19 @@ unit -> t
    val make : ?conn_closed:(conn -> unit) -> - callback:(conn -> Http.Request.t -> body -> (Http.Response.t * body) IO.t) -> + callback:(conn -> Http.Request.t -> body -> response IO.t) -> unit -> t
    val respond : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> body:body -> unit -> - (Http.Response.t * body) IO.t

    respond ?headers ?flush ~status ~body will respond to an HTTP request with the given status code and response body. If flush is true, then every response chunk will be flushed to the network rather than being buffered. flush is true by default. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : + response IO.t

    respond ?headers ~status ~body will respond to an HTTP request with the given status code and response body. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> body:string -> unit -> - (Http.Response.t * body) IO.t
    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve a URI and a docroot into a concrete local filename.

    • deprecated Please use Cohttp.Path.resolve_local_file.
    val respond_error : + response IO.t
    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve a URI and a docroot into a concrete local filename.

    • deprecated Please use Cohttp.Path.resolve_local_file.
    val respond_error : ?headers:Http.Header.t -> ?status:Http.Status.t -> body:string -> diff --git a/cohttp-mirage/Cohttp_mirage/Static/HTTP/argument-2-S/IO/index.html b/cohttp-mirage/Cohttp_mirage/Static/HTTP/argument-2-S/IO/index.html index 318c538a5..4d32a4298 100644 --- a/cohttp-mirage/Cohttp_mirage/Static/HTTP/argument-2-S/IO/index.html +++ b/cohttp-mirage/Cohttp_mirage/Static/HTTP/argument-2-S/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp-mirage.Cohttp_mirage.Static.HTTP.S.IO)

    Module S.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp-mirage.Cohttp_mirage.Static.HTTP.S.IO)

    Module S.IO

    include Cohttp.S.IO with type 'a t = 'a Lwt.t
    type 'a t = 'a Lwt.t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    type error
    val catch : (unit -> 'a t) -> ('a, error) Stdlib.result t

    catch f is f () >|= Result.ok, unless f fails with an IO error, in which case it returns the error.

    val pp_error : Stdlib.Format.formatter -> error -> unit
    diff --git a/cohttp-mirage/Cohttp_mirage/Static/HTTP/argument-2-S/index.html b/cohttp-mirage/Cohttp_mirage/Static/HTTP/argument-2-S/index.html index 7dabd315e..dfb22058b 100644 --- a/cohttp-mirage/Cohttp_mirage/Static/HTTP/argument-2-S/index.html +++ b/cohttp-mirage/Cohttp_mirage/Static/HTTP/argument-2-S/index.html @@ -1,7 +1,8 @@ -S (cohttp-mirage.Cohttp_mirage.Static.HTTP.S)

    Parameter HTTP.S

    include Cohttp.Generic.Server.S +S (cohttp-mirage.Cohttp_mirage.Static.HTTP.S)

    Parameter HTTP.S

    include Cohttp.Generic.Server.S with type body = Cohttp_lwt.Body.t - and module IO := IO
    type body = Cohttp_lwt.Body.t
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of Http.Response.t * body
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unitIO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : + and module IO := IO + and type response = Http.Response.t * Cohttp_lwt.Body.t
    type body = Cohttp_lwt.Body.t
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of response
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unit IO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : ?conn_closed:(conn -> unit) -> callback:(conn -> Http.Request.t -> body -> response_action IO.t) -> unit -> @@ -15,21 +16,19 @@ unit -> t
    val make : ?conn_closed:(conn -> unit) -> - callback:(conn -> Http.Request.t -> body -> (Http.Response.t * body) IO.t) -> + callback:(conn -> Http.Request.t -> body -> response IO.t) -> unit -> t
    val respond : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> body:body -> unit -> - (Http.Response.t * body) IO.t

    respond ?headers ?flush ~status ~body will respond to an HTTP request with the given status code and response body. If flush is true, then every response chunk will be flushed to the network rather than being buffered. flush is true by default. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : + response IO.t

    respond ?headers ~status ~body will respond to an HTTP request with the given status code and response body. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> body:string -> unit -> - (Http.Response.t * body) IO.t
    val callback : t -> IO.conn -> IO.ic -> IO.oc -> unit IO.t
    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve a URI and a docroot into a concrete local filename.

    • deprecated Please use Cohttp.Path.resolve_local_file.
    val respond_error : + response IO.t
    val callback : t -> IO.conn -> IO.ic -> IO.oc -> unit IO.t
    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve a URI and a docroot into a concrete local filename.

    • deprecated Please use Cohttp.Path.resolve_local_file.
    val respond_error : ?headers:Http.Header.t -> ?status:Http.Status.t -> body:string -> diff --git a/cohttp-mirage/Cohttp_mirage/Static/HTTP/index.html b/cohttp-mirage/Cohttp_mirage/Static/HTTP/index.html index 886e21f28..44baea4a5 100644 --- a/cohttp-mirage/Cohttp_mirage/Static/HTTP/index.html +++ b/cohttp-mirage/Cohttp_mirage/Static/HTTP/index.html @@ -1,5 +1,5 @@ -HTTP (cohttp-mirage.Cohttp_mirage.Static.HTTP)

    Module Static.HTTP

    Plain HTTP file serving from a read-only key-value store.

    start http_port ?request_fn fs http will start a static HTTP server listening on http_port. The files to serve will be looked up from the fs key-value store.

    If request_fn is supplied, the URI and default header set (including the MIME content-type header) will be passed to it and the response used as the response header set instead.

    Parameters

    module FS : Mirage_kv.RO

    Signature

    val start : +HTTP (cohttp-mirage.Cohttp_mirage.Static.HTTP)

    Module Static.HTTP

    Plain HTTP file serving from a read-only key-value store.

    start http_port ?request_fn fs http will start a static HTTP server listening on http_port. The files to serve will be looked up from the fs key-value store.

    If request_fn is supplied, the URI and default header set (including the MIME content-type header) will be passed to it and the response used as the response header set instead.

    Parameters

    module FS : Mirage_kv.RO

    Signature

    val start : http_port:int -> ?request_fn:(Uri.t -> Http.Header.t -> Http.Header.t) -> FS.t -> diff --git a/cohttp-mirage/Cohttp_mirage/Static/index.html b/cohttp-mirage/Cohttp_mirage/Static/index.html index 917387de0..274b2eddf 100644 --- a/cohttp-mirage/Cohttp_mirage/Static/index.html +++ b/cohttp-mirage/Cohttp_mirage/Static/index.html @@ -1,2 +1,2 @@ -Static (cohttp-mirage.Cohttp_mirage.Static)

    Module Cohttp_mirage.Static

    Serve static HTTP sites from a Mirage key-value store.

    Serve static HTTP sites from a Mirage key-value store.

    module HTTP (FS : Mirage_kv.RO) (S : Cohttp_lwt.S.Server) : sig ... end

    Plain HTTP file serving from a read-only key-value store.

    +Static (cohttp-mirage.Cohttp_mirage.Static)

    Module Cohttp_mirage.Static

    Serve static HTTP sites from a Mirage key-value store.

    Serve static HTTP sites from a Mirage key-value store.

    module HTTP (FS : Mirage_kv.RO) (S : Cohttp_lwt.S.Server) : sig ... end

    Plain HTTP file serving from a read-only key-value store.

    diff --git a/cohttp-mirage/Cohttp_mirage/index.html b/cohttp-mirage/Cohttp_mirage/index.html index 9cfe29a4c..35126677e 100644 --- a/cohttp-mirage/Cohttp_mirage/index.html +++ b/cohttp-mirage/Cohttp_mirage/index.html @@ -1,2 +1,2 @@ -Cohttp_mirage (cohttp-mirage.Cohttp_mirage)

    Module Cohttp_mirage

    IO modules

    module IO (Channel : Mirage_channel.S) : sig ... end
    module Net = Net.Make

    The resulting modtype:Cohttp_lwt.S.Net module can be used to build the low-level client interfaces with module:Cohttp_lwt.Connection.Make and from that module:Cohttp_lwt.Connection_cache.Make.

    client modules

    simple, high-level interace

    module Client : sig ... end

    server modules

    module Static : sig ... end

    Serve static HTTP sites from a Mirage key-value store.

    module Server : sig ... end

    HTTP server with conduit.

    +Cohttp_mirage (cohttp-mirage.Cohttp_mirage)

    Module Cohttp_mirage

    IO modules

    module IO (Channel : Mirage_channel.S) : sig ... end
    module Net = Net.Make

    The resulting Cohttp_lwt.S.Net module can be used to build the low-level client interfaces with Cohttp_lwt.Connection.Make and from that Cohttp_lwt.Connection_cache.Make.

    client modules

    simple, high-level interface

    module Client : sig ... end

    server modules

    module Static : sig ... end

    Serve static HTTP sites from a Mirage key-value store.

    module Server : sig ... end

    HTTP server with conduit.

    diff --git a/cohttp-mirage/index.html b/cohttp-mirage/index.html index 37fabd0d3..787e4ccf5 100644 --- a/cohttp-mirage/index.html +++ b/cohttp-mirage/index.html @@ -1,2 +1,2 @@ -index (cohttp-mirage.index)

    cohttp-mirage index

    Library cohttp-mirage

    The entry point of this library is the module: Cohttp_mirage.

    +index (cohttp-mirage.index)

    cohttp-mirage index

    Library cohttp-mirage

    The entry point of this library is the module: Cohttp_mirage.

    diff --git a/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/Body/Encoding/index.html b/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/Body/Encoding/index.html index c1ac15249..6ac057758 100644 --- a/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/Body/Encoding/index.html +++ b/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/Body/Encoding/index.html @@ -1,2 +1,2 @@ -Encoding (cohttp-server-lwt-unix.Cohttp_server_lwt_unix.Body.Encoding)

    Module Body.Encoding

    type t
    val fixed : int64 -> t
    val chunked : t
    +Encoding (cohttp-server-lwt-unix.Cohttp_server_lwt_unix.Body.Encoding)

    Module Body.Encoding

    type t

    HTTP body encoding

    val fixed : int64 -> t
    val chunked : t
    diff --git a/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/Body/Substring/index.html b/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/Body/Substring/index.html index 9aa5f012d..c6e223232 100644 --- a/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/Body/Substring/index.html +++ b/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/Body/Substring/index.html @@ -1,2 +1,2 @@ -Substring (cohttp-server-lwt-unix.Cohttp_server_lwt_unix.Body.Substring)

    Module Body.Substring

    type t = {
    1. base : string;
    2. pos : int;
    3. len : int;
    }
    +Substring (cohttp-server-lwt-unix.Cohttp_server_lwt_unix.Body.Substring)

    Module Body.Substring

    type t = {
    1. base : string;
    2. pos : int;
    3. len : int;
    }
    diff --git a/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/Body/index.html b/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/Body/index.html index 60175400f..af04fedc3 100644 --- a/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/Body/index.html +++ b/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/Body/index.html @@ -1,2 +1,2 @@ -Body (cohttp-server-lwt-unix.Cohttp_server_lwt_unix.Body)

    Module Cohttp_server_lwt_unix.Body

    module Encoding : sig ... end
    type t
    val string : ?encoding:Encoding.t -> string -> t
    module Substring : sig ... end
    val stream : ?encoding:Encoding.t -> (unit -> Substring.t option Lwt.t) -> t
    +Body (cohttp-server-lwt-unix.Cohttp_server_lwt_unix.Body)

    Module Cohttp_server_lwt_unix.Body

    module Encoding : sig ... end
    type t

    A response body

    val string : ?encoding:Encoding.t -> string -> t

    string ?encoding s respond with body s.

    ?encoding the encoding to use. by default this is Encoding.fixed

    module Substring : sig ... end
    val stream : ?encoding:Encoding.t -> (unit -> Substring.t option Lwt.t) -> t

    stream ?encoding f respond with body generated by repeatedly applying f. When f returns None, it will be considered terminated.

    ?encoding is the encoding to use. By default this is Encoding.chunked.

    diff --git a/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/Context/index.html b/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/Context/index.html index 4afcef8b3..c6eac37cf 100644 --- a/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/Context/index.html +++ b/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/Context/index.html @@ -1,2 +1,2 @@ -Context (cohttp-server-lwt-unix.Cohttp_server_lwt_unix.Context)

    Module Cohttp_server_lwt_unix.Context

    type t
    val request : t -> Http.Request.t
    val read_body : t -> string Lwt.t
    val discard_body : t -> unit Lwt.t
    val respond : t -> Http.Response.t -> Body.t -> unit Lwt.t
    +Context (cohttp-server-lwt-unix.Cohttp_server_lwt_unix.Context)

    Module Cohttp_server_lwt_unix.Context

    type t

    A request context

    val request : t -> Http.Request.t

    request t returns the HTTP request

    val read_body : t -> string Lwt.t

    read_body t read the request body as a string

    val discard_body : t -> unit Lwt.t

    discard_body t discard the request body

    val respond : t -> Http.Response.t -> Body.t -> unit Lwt.t

    respond t response body respond to the request with response and body

    diff --git a/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/index.html b/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/index.html index b5a87c133..f9e42cae8 100644 --- a/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/index.html +++ b/cohttp-server-lwt-unix/Cohttp_server_lwt_unix/index.html @@ -1,5 +1,26 @@ -Cohttp_server_lwt_unix (cohttp-server-lwt-unix.Cohttp_server_lwt_unix)

    Module Cohttp_server_lwt_unix

    module Body : sig ... end
    module Context : sig ... end
    type t
    val create : ?on_exn:(exn -> unit) -> (Context.t -> unit Lwt.t) -> t
    val handle_connection : +Cohttp_server_lwt_unix (cohttp-server-lwt-unix.Cohttp_server_lwt_unix)

    Module Cohttp_server_lwt_unix

    High performance lwt server

    This module is an alternative to the server offered in Cohttp_lwt_unix.Server. It's a simplified implementation that has less functionality but offers more control and better performance. The differences are as follows:

    • Vastly improved performance due to optimized buffer handling
    • No dependency on conduit
    • No builtin logging

    An example server:

    open Lwt.Syntax
    +
    +let server_callback ctx =
    +  Lwt.join
    +    [
    +      Cohttp_server_lwt_unix.ontext.discard_body ctx;
    +      Cohttp_server_lwt_unix.ontext.respond ctx (Http.Response.make ())
    +        (Cohttp_server_lwt_unix.Body.string "hello world");
    +    ]
    +
    +let main () =
    +  let* _server =
    +    let listen_address = Unix.(ADDR_INET (inet_addr_loopback, 8080)) in
    +    let server = Cohttp_server_lwt_unix.create server_callback in
    +    Lwt_io.establish_server_with_client_address ~backlog:10_000
    +      listen_address (fun _addr ch ->
    +        Cohttp_server_lwt_unix.handle_connection server ch)
    +  in
    +  let forever, _ = Lwt.wait () in
    +  forever
    +
    +let () = ignore (Lwt_main.run (main ()))
    module Body : sig ... end
    module Context : sig ... end
    type t

    The type of an HTTP server able to handle requests.

    val create : ?on_exn:(exn -> unit) -> (Context.t -> unit Lwt.t) -> t

    create ?on_exn f creates an HTTP server that will handle every incoming request with f concurrently.

    on_exn will be called on exceptions not caught in f or raised by the server itself. If on_exn isn't provided Lwt.async_exception_hook will be used.

    val handle_connection : t -> (Lwt_io.input_channel * Lwt_io.output_channel) -> - unit Lwt.t
    + unit Lwt.t

    handle_connection t (i, o) will handle all HTTP requests incoming from i and write them to o.

    This function should be used with Lwt_io.establish_server_with_client_address to setup a running HTTP server.

    diff --git a/cohttp-server-lwt-unix/index.html b/cohttp-server-lwt-unix/index.html index 171516591..a22706fb7 100644 --- a/cohttp-server-lwt-unix/index.html +++ b/cohttp-server-lwt-unix/index.html @@ -1,2 +1,2 @@ -index (cohttp-server-lwt-unix.index)

    cohttp-server-lwt-unix index

    Library cohttp-server-lwt-unix

    The entry point of this library is the module: Cohttp_server_lwt_unix.

    +index (cohttp-server-lwt-unix.index)

    cohttp-server-lwt-unix index

    Library cohttp-server-lwt-unix

    The entry point of this library is the module: Cohttp_server_lwt_unix.

    diff --git a/cohttp-top/Cohttp_top/index.html b/cohttp-top/Cohttp_top/index.html index c16a0afc0..d8f546ab2 100644 --- a/cohttp-top/Cohttp_top/index.html +++ b/cohttp-top/Cohttp_top/index.html @@ -1,5 +1,5 @@ -Cohttp_top (cohttp-top.Cohttp_top)

    Module Cohttp_top

    val printers : string list
    val eval_string : +Cohttp_top (cohttp-top.Cohttp_top)

    Module Cohttp_top

    val printers : string list
    val eval_string : ?print_outcome:bool -> ?err_formatter:Stdlib.Format.formatter -> string -> diff --git a/cohttp-top/index.html b/cohttp-top/index.html index d55a38f7a..542e4b5a8 100644 --- a/cohttp-top/index.html +++ b/cohttp-top/index.html @@ -1,2 +1,2 @@ -index (cohttp-top.index)

    cohttp-top index

    Library cohttp-top

    The entry point of this library is the module: Cohttp_top.

    +index (cohttp-top.index)

    cohttp-top index

    Library cohttp-top

    The entry point of this library is the module: Cohttp_top.

    diff --git a/cohttp/Cohttp/Accept/index.html b/cohttp/Cohttp/Accept/index.html index e6f14b2d1..4016adf08 100644 --- a/cohttp/Cohttp/Accept/index.html +++ b/cohttp/Cohttp/Accept/index.html @@ -1,2 +1,2 @@ -Accept (cohttp.Cohttp.Accept)

    Module Cohttp.Accept

    Accept-Encoding HTTP header parsing and generation

    type q = int

    Qualities are integers between 0 and 1000. A header with "q=0.7" corresponds to a quality of 700.

    val sexp_of_q : q -> Sexplib0.Sexp.t
    val q_of_sexp : Sexplib0.Sexp.t -> q
    type 'a qlist = (q * 'a) list

    Lists, annotated with qualities.

    val sexp_of_qlist : ('a -> Sexplib0.Sexp.t) -> 'a qlist -> Sexplib0.Sexp.t
    val qlist_of_sexp : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a qlist
    val qsort : 'a qlist -> 'a qlist

    Sort by quality, biggest first. Respect the initial ordering.

    type p = string * string
    val sexp_of_p : p -> Sexplib0.Sexp.t
    val p_of_sexp : Sexplib0.Sexp.t -> p
    type media_range =
    1. | MediaType of string * string
    2. | AnyMediaSubtype of string
    3. | AnyMedia
    val sexp_of_media_range : media_range -> Sexplib0.Sexp.t
    val media_range_of_sexp : Sexplib0.Sexp.t -> media_range
    type charset =
    1. | Charset of string
    2. | AnyCharset
    val sexp_of_charset : charset -> Sexplib0.Sexp.t
    val charset_of_sexp : Sexplib0.Sexp.t -> charset
    type encoding =
    1. | Encoding of string
    2. | Gzip
    3. | Compress
    4. | Deflate
    5. | Identity
    6. | AnyEncoding
    val sexp_of_encoding : encoding -> Sexplib0.Sexp.t
    val encoding_of_sexp : Sexplib0.Sexp.t -> encoding
    type language =
    1. | Language of string list
    2. | AnyLanguage

    Basic language range tag. "en-gb" is represented as Language ["en"; "gb"].

    val sexp_of_language : language -> Sexplib0.Sexp.t
    val language_of_sexp : Sexplib0.Sexp.t -> language
    val media_ranges : string option -> (media_range * p list) qlist
    val charsets : string option -> charset qlist
    val encodings : string option -> encoding qlist
    val languages : string option -> language qlist
    val string_of_media_range : (media_range * p list) -> q -> string
    val string_of_charset : charset -> q -> string
    val string_of_encoding : encoding -> q -> string
    val string_of_language : language -> q -> string
    val string_of_media_ranges : (media_range * p list) qlist -> string
    val string_of_charsets : charset qlist -> string
    val string_of_encodings : encoding qlist -> string
    val string_of_languages : language qlist -> string
    +Accept (cohttp.Cohttp.Accept)

    Module Cohttp.Accept

    Accept-Encoding HTTP header parsing and generation

    type q = int

    Qualities are integers between 0 and 1000. A header with "q=0.7" corresponds to a quality of 700.

    val sexp_of_q : q -> Sexplib0.Sexp.t
    val q_of_sexp : Sexplib0.Sexp.t -> q
    type 'a qlist = (q * 'a) list

    Lists, annotated with qualities.

    val sexp_of_qlist : ('a -> Sexplib0.Sexp.t) -> 'a qlist -> Sexplib0.Sexp.t
    val qlist_of_sexp : (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a qlist
    val qsort : 'a qlist -> 'a qlist

    Sort by quality, biggest first. Respect the initial ordering.

    type p = string * string
    val sexp_of_p : p -> Sexplib0.Sexp.t
    val p_of_sexp : Sexplib0.Sexp.t -> p
    type media_range =
    1. | MediaType of string * string
    2. | AnyMediaSubtype of string
    3. | AnyMedia
    val sexp_of_media_range : media_range -> Sexplib0.Sexp.t
    val media_range_of_sexp : Sexplib0.Sexp.t -> media_range
    type charset =
    1. | Charset of string
    2. | AnyCharset
    val sexp_of_charset : charset -> Sexplib0.Sexp.t
    val charset_of_sexp : Sexplib0.Sexp.t -> charset
    type encoding =
    1. | Encoding of string
    2. | Gzip
    3. | Compress
    4. | Deflate
    5. | Identity
    6. | AnyEncoding
    val sexp_of_encoding : encoding -> Sexplib0.Sexp.t
    val encoding_of_sexp : Sexplib0.Sexp.t -> encoding
    type language =
    1. | Language of string list
    2. | AnyLanguage

    Basic language range tag. "en-gb" is represented as Language ["en"; "gb"].

    val sexp_of_language : language -> Sexplib0.Sexp.t
    val language_of_sexp : Sexplib0.Sexp.t -> language
    val media_ranges : string option -> (media_range * p list) qlist
    val charsets : string option -> charset qlist
    val encodings : string option -> encoding qlist
    val languages : string option -> language qlist
    val string_of_media_range : (media_range * p list) -> q -> string
    val string_of_charset : charset -> q -> string
    val string_of_encoding : encoding -> q -> string
    val string_of_language : language -> q -> string
    val string_of_media_ranges : (media_range * p list) qlist -> string
    val string_of_charsets : charset qlist -> string
    val string_of_encodings : encoding qlist -> string
    val string_of_languages : language qlist -> string
    diff --git a/cohttp/Cohttp/Auth/index.html b/cohttp/Cohttp/Auth/index.html index df218e7f3..24e50fdfa 100644 --- a/cohttp/Cohttp/Auth/index.html +++ b/cohttp/Cohttp/Auth/index.html @@ -1,2 +1,2 @@ -Auth (cohttp.Cohttp.Auth)

    Module Cohttp.Auth

    HTTP Authentication and Authorization header parsing and generation

    type challenge = [
    1. | `Basic of string
      (*

      Basic authentication within a realm

      *)
    ]

    HTTP authentication challenge types

    val sexp_of_challenge : challenge -> Sexplib0.Sexp.t
    val challenge_of_sexp : Sexplib0.Sexp.t -> challenge
    val __challenge_of_sexp__ : Sexplib0.Sexp.t -> challenge
    type credential = [
    1. | `Basic of string * string
      (*

      Basic authorization with a username and password

      *)
    2. | `Other of string
      (*

      An unknown credential type that will be passed straight through to the application layer

      *)
    ]

    HTTP authorization credential types

    val sexp_of_credential : credential -> Sexplib0.Sexp.t
    val credential_of_sexp : Sexplib0.Sexp.t -> credential
    val __credential_of_sexp__ : Sexplib0.Sexp.t -> credential
    val string_of_credential : credential -> string

    string_of_credential converts the credential to a string compatible with the HTTP/1.1 wire format for authorization credentials ("responses")

    val credential_of_string : string -> credential

    credential_of_string cred_s converts an HTTP response to an authentication challenge into a credential. If the credential is not recognized, `Other cred_s is returned.

    val string_of_challenge : challenge -> string

    string_of_challenge challenge converts the challenge to a string compatible with the HTTP/1.1 wire format for authentication challenges.

    For example, a `Basic challenge with realm "foo" will be marshalled to "Basic realm=foo", which can then be combined with a www-authenticate HTTP header and sent back to the client. There is a helper function Header.add_authorization_req that does just this.

    +Auth (cohttp.Cohttp.Auth)

    Module Cohttp.Auth

    HTTP Authentication and Authorization header parsing and generation

    type challenge = [
    1. | `Basic of string
      (*

      Basic authentication within a realm

      *)
    ]

    HTTP authentication challenge types

    val sexp_of_challenge : challenge -> Sexplib0.Sexp.t
    val challenge_of_sexp : Sexplib0.Sexp.t -> challenge
    val __challenge_of_sexp__ : Sexplib0.Sexp.t -> challenge
    type credential = [
    1. | `Basic of string * string
      (*

      Basic authorization with a username and password

      *)
    2. | `Other of string
      (*

      An unknown credential type that will be passed straight through to the application layer

      *)
    ]

    HTTP authorization credential types

    val sexp_of_credential : credential -> Sexplib0.Sexp.t
    val credential_of_sexp : Sexplib0.Sexp.t -> credential
    val __credential_of_sexp__ : Sexplib0.Sexp.t -> credential
    val string_of_credential : credential -> string

    string_of_credential converts the credential to a string compatible with the HTTP/1.1 wire format for authorization credentials ("responses")

    val credential_of_string : string -> credential

    credential_of_string cred_s converts an HTTP response to an authentication challenge into a credential. If the credential is not recognized, `Other cred_s is returned.

    val string_of_challenge : challenge -> string

    string_of_challenge challenge converts the challenge to a string compatible with the HTTP/1.1 wire format for authentication challenges.

    For example, a `Basic challenge with realm "foo" will be marshalled to "Basic realm=foo", which can then be combined with a www-authenticate HTTP header and sent back to the client. There is a helper function Header.add_authorization_req that does just this.

    diff --git a/cohttp/Cohttp/Body/index.html b/cohttp/Cohttp/Body/index.html index d3dc29f53..c2327d435 100644 --- a/cohttp/Cohttp/Body/index.html +++ b/cohttp/Cohttp/Body/index.html @@ -1,2 +1,2 @@ -Body (cohttp.Cohttp.Body)

    Module Cohttp.Body

    HTTP request and response body handling

    type t = [
    1. | `Empty
    2. | `String of string
    3. | `Strings of string list
    ]

    Every HTTP body can at least be an empty value or a string

    val sexp_of_t : t -> Sexplib0.Sexp.t
    val t_of_sexp : Sexplib0.Sexp.t -> t
    val __t_of_sexp__ : Sexplib0.Sexp.t -> t

    Signature for the core of HTTP body handling. Implementations will extend this signature to add more functions for streaming responses via backend-specific functionality.

    include S.Body with type t := t
    val to_string : t -> string
    val to_string_list : t -> string list
    val to_form : t -> (string * string list) list
    val empty : t
    val is_empty : t -> bool
    val of_string : string -> t
    val of_string_list : string list -> t
    val of_form : ?scheme:string -> (string * string list) list -> t
    val map : (string -> string) -> t -> t
    val transfer_encoding : t -> Transfer.encoding
    val length : t -> int64
    +Body (cohttp.Cohttp.Body)

    Module Cohttp.Body

    HTTP request and response body handling

    type t = [
    1. | `Empty
    2. | `String of string
    3. | `Strings of string list
    ]

    Every HTTP body can at least be an empty value or a string

    val sexp_of_t : t -> Sexplib0.Sexp.t
    val t_of_sexp : Sexplib0.Sexp.t -> t
    val __t_of_sexp__ : Sexplib0.Sexp.t -> t

    Signature for the core of HTTP body handling. Implementations will extend this signature to add more functions for streaming responses via backend-specific functionality.

    include S.Body with type t := t
    val to_string : t -> string
    val to_string_list : t -> string list
    val to_form : t -> (string * string list) list
    val empty : t
    val is_empty : t -> bool
    val of_string : string -> t
    val of_string_list : string list -> t
    val of_form : ?scheme:string -> (string * string list) list -> t
    val map : (string -> string) -> t -> t
    val transfer_encoding : t -> Transfer.encoding
    val length : t -> int64
    diff --git a/cohttp/Cohttp/Code/index.html b/cohttp/Cohttp/Code/index.html index 6f030c9de..a9fd1cc68 100644 --- a/cohttp/Cohttp/Code/index.html +++ b/cohttp/Cohttp/Code/index.html @@ -1,2 +1,2 @@ -Code (cohttp.Cohttp.Code)

    Module Cohttp.Code

    type version = [
    1. | `HTTP_1_0
    2. | `HTTP_1_1
    3. | `Other of string
    ]
    val sexp_of_version : version -> Sexplib0.Sexp.t
    val version_of_sexp : Sexplib0.Sexp.t -> version
    val __version_of_sexp__ : Sexplib0.Sexp.t -> version
    type meth = [
    1. | `GET
    2. | `POST
    3. | `HEAD
    4. | `DELETE
    5. | `PATCH
    6. | `PUT
    7. | `OPTIONS
    8. | `TRACE
    9. | `CONNECT
    10. | `Other of string
    ]
    val sexp_of_meth : meth -> Sexplib0.Sexp.t
    val meth_of_sexp : Sexplib0.Sexp.t -> meth
    val __meth_of_sexp__ : Sexplib0.Sexp.t -> meth
    type informational_status = [
    1. | `Continue
      (*

      Client should continue with request

      *)
    2. | `Switching_protocols
      (*

      Server is switching protocols

      *)
    3. | `Processing
      (*

      Server has received and is processing the request

      *)
    4. | `Checkpoint
      (*

      resume aborted PUT or POST requests

      *)
    ]

    Informational

    val sexp_of_informational_status : informational_status -> Sexplib0.Sexp.t
    val informational_status_of_sexp : Sexplib0.Sexp.t -> informational_status
    val __informational_status_of_sexp__ : Sexplib0.Sexp.t -> informational_status
    type success_status = [
    1. | `OK
      (*

      standard response for successful HTTP requests

      *)
    2. | `Created
      (*

      request has been fulfilled; new resource created

      *)
    3. | `Accepted
      (*

      request accepted, processing pending

      *)
    4. | `Non_authoritative_information
      (*

      request processed, information may be from another source

      *)
    5. | `No_content
      (*

      request processed, no content returned

      *)
    6. | `Reset_content
      (*

      request processed, no content returned, reset document view

      *)
    7. | `Partial_content
      (*

      partial resource return due to request header

      *)
    8. | `Multi_status
      (*

      XML, can contain multiple separate responses

      *)
    9. | `Already_reported
      (*

      results previously returned

      *)
    10. | `Im_used
      (*

      request fulfilled, reponse is instance-manipulations

      *)
    ]

    Success

    val sexp_of_success_status : success_status -> Sexplib0.Sexp.t
    val success_status_of_sexp : Sexplib0.Sexp.t -> success_status
    val __success_status_of_sexp__ : Sexplib0.Sexp.t -> success_status
    type redirection_status = [
    1. | `Multiple_choices
      (*

      multiple options for the resource delivered

      *)
    2. | `Moved_permanently
      (*

      this and all future requests directed to the given URI

      *)
    3. | `Found
      (*

      temporary response to request found via alternative URI

      *)
    4. | `See_other
      (*

      permanent response to request found via alternative URI

      *)
    5. | `Not_modified
      (*

      resource has not been modified since last requested

      *)
    6. | `Use_proxy
      (*

      content located elsewhere, retrieve from there

      *)
    7. | `Switch_proxy
      (*

      subsequent requests should use the specified proxy

      *)
    8. | `Temporary_redirect
      (*

      connect again to different URI as provided

      *)
    9. | `Permanent_redirect
      (*

      connect again to a different URI using the same method

      *)
    ]

    Redirection

    val sexp_of_redirection_status : redirection_status -> Sexplib0.Sexp.t
    val redirection_status_of_sexp : Sexplib0.Sexp.t -> redirection_status
    val __redirection_status_of_sexp__ : Sexplib0.Sexp.t -> redirection_status
    type client_error_status = [
    1. | `Bad_request
      (*

      request cannot be fulfilled due to bad syntax

      *)
    2. | `Unauthorized
      (*

      authentication is possible but has failed

      *)
    3. | `Payment_required
      (*

      payment required, reserved for future use

      *)
    4. | `Forbidden
      (*

      server refuses to respond to request

      *)
    5. | `Not_found
      (*

      requested resource could not be found

      *)
    6. | `Method_not_allowed
      (*

      request method not supported by that resource

      *)
    7. | `Not_acceptable
      (*

      content not acceptable according to the Accept headers

      *)
    8. | `Proxy_authentication_required
      (*

      client must first authenticate itself with the proxy

      *)
    9. | `Request_timeout
      (*

      server timed out waiting for the request

      *)
    10. | `Conflict
      (*

      request could not be processed because of conflict

      *)
    11. | `Gone
      (*

      resource is no longer available and will not be available again

      *)
    12. | `Length_required
      (*

      request did not specify the length of its content

      *)
    13. | `Precondition_failed
      (*

      server does not meet request preconditions

      *)
    14. | `Request_entity_too_large
      (*

      request is larger than the server is willing or able to process

      *)
    15. | `Request_uri_too_long
      (*

      URI provided was too long for the server to process

      *)
    16. | `Unsupported_media_type
      (*

      server does not support media type

      *)
    17. | `Requested_range_not_satisfiable
      (*

      client has asked for unprovidable portion of the file

      *)
    18. | `Expectation_failed
      (*

      server cannot meet requirements of Expect request-header field

      *)
    19. | `I_m_a_teapot
      (*

      I'm a teapot

      *)
    20. | `Enhance_your_calm
      (*

      Twitter rate limiting

      *)
    21. | `Unprocessable_entity
      (*

      request unable to be followed due to semantic errors

      *)
    22. | `Locked
      (*

      resource that is being accessed is locked

      *)
    23. | `Failed_dependency
      (*

      request failed due to failure of a previous request

      *)
    24. | `Upgrade_required
      (*

      client should switch to a different protocol

      *)
    25. | `Precondition_required
      (*

      origin server requires the request to be conditional

      *)
    26. | `Too_many_requests
      (*

      user has sent too many requests in a given amount of time

      *)
    27. | `Request_header_fields_too_large
      (*

      server is unwilling to process the request

      *)
    28. | `No_response
      (*

      server returns no information and closes the connection

      *)
    29. | `Retry_with
      (*

      request should be retried after performing action

      *)
    30. | `Blocked_by_windows_parental_controls
      (*

      Windows Parental Controls blocking access to webpage

      *)
    31. | `Wrong_exchange_server
      (*

      the server cannot reach the client's mailbox

      *)
    32. | `Client_closed_request
      (*

      connection closed by client while HTTP server is processing

      *)
    ]

    Client_error

    val sexp_of_client_error_status : client_error_status -> Sexplib0.Sexp.t
    val client_error_status_of_sexp : Sexplib0.Sexp.t -> client_error_status
    val __client_error_status_of_sexp__ : Sexplib0.Sexp.t -> client_error_status
    type server_error_status = [
    1. | `Internal_server_error
      (*

      generic error message

      *)
    2. | `Not_implemented
      (*

      server does not recognise method or lacks ability to fulfill

      *)
    3. | `Bad_gateway
      (*

      server received an invalid response from upstream server

      *)
    4. | `Service_unavailable
      (*

      server is currently unavailable

      *)
    5. | `Gateway_timeout
      (*

      gateway did not receive response from upstream server

      *)
    6. | `Http_version_not_supported
      (*

      server does not support the HTTP protocol version

      *)
    7. | `Variant_also_negotiates
      (*

      content negotiation for the request results in a circular reference

      *)
    8. | `Insufficient_storage
      (*

      server is unable to store the representation

      *)
    9. | `Loop_detected
      (*

      server detected an infinite loop while processing the request

      *)
    10. | `Bandwidth_limit_exceeded
      (*

      bandwidth limit exceeded

      *)
    11. | `Not_extended
      (*

      further extensions to the request are required

      *)
    12. | `Network_authentication_required
      (*

      client needs to authenticate to gain network access

      *)
    13. | `Network_read_timeout_error
      (*

      network read timeout behind the proxy

      *)
    14. | `Network_connect_timeout_error
      (*

      network connect timeout behind the proxy

      *)
    ]

    Server_error

    val sexp_of_server_error_status : server_error_status -> Sexplib0.Sexp.t
    val server_error_status_of_sexp : Sexplib0.Sexp.t -> server_error_status
    val __server_error_status_of_sexp__ : Sexplib0.Sexp.t -> server_error_status
    val sexp_of_status : status -> Sexplib0.Sexp.t
    val status_of_sexp : Sexplib0.Sexp.t -> status
    val __status_of_sexp__ : Sexplib0.Sexp.t -> status
    type status_code = [
    1. | `Code of int
    2. | status
    ]
    val sexp_of_status_code : status_code -> Sexplib0.Sexp.t
    val status_code_of_sexp : Sexplib0.Sexp.t -> status_code
    val __status_code_of_sexp__ : Sexplib0.Sexp.t -> status_code
    val string_of_version : version -> string

    Convert a version to a string.

    val version_of_string : string -> version

    Convert a string to a version.

    val compare_version : version -> version -> int

    Comparison function for version values

    val string_of_method : meth -> string

    Convert a method to a string.

    val method_of_string : string -> meth

    Convert a string to a method.

    val compare_method : meth -> meth -> int

    Comparison function for method values

    val status_of_code : int -> status_code

    Generate status values from int codes.

    val code_of_status : status_code -> int

    Generate an int code from a status value.

    val string_of_status : status_code -> string

    Give a description of the given status value.

    val reason_phrase_of_code : int -> string

    Give a description of the given int code.

    val is_informational : int -> bool

    Is the given int code belong to the class of "informational" return code ?

    val is_success : int -> bool

    Is the given int code belong to the class of "success" return code ?

    val is_redirection : int -> bool

    Is the given int code belong to the class of "redirection" return code ?

    val is_client_error : int -> bool

    Is the given int code belong to the class of "client_error" return code ?

    val is_server_error : int -> bool

    Is the given int code belong to the class of "server_error" return code ?

    val is_error : int -> bool

    Return true for client and server error status codes.

    +Code (cohttp.Cohttp.Code)

    Module Cohttp.Code

    type version = [
    1. | `HTTP_1_0
    2. | `HTTP_1_1
    3. | `Other of string
    ]
    val sexp_of_version : version -> Sexplib0.Sexp.t
    val version_of_sexp : Sexplib0.Sexp.t -> version
    val __version_of_sexp__ : Sexplib0.Sexp.t -> version
    type meth = [
    1. | `GET
    2. | `POST
    3. | `HEAD
    4. | `DELETE
    5. | `PATCH
    6. | `PUT
    7. | `OPTIONS
    8. | `TRACE
    9. | `CONNECT
    10. | `Other of string
    ]
    val sexp_of_meth : meth -> Sexplib0.Sexp.t
    val meth_of_sexp : Sexplib0.Sexp.t -> meth
    val __meth_of_sexp__ : Sexplib0.Sexp.t -> meth
    type informational_status = [
    1. | `Continue
      (*

      Client should continue with request

      *)
    2. | `Switching_protocols
      (*

      Server is switching protocols

      *)
    3. | `Processing
      (*

      Server has received and is processing the request

      *)
    4. | `Checkpoint
      (*

      resume aborted PUT or POST requests

      *)
    ]

    Informational

    val sexp_of_informational_status : informational_status -> Sexplib0.Sexp.t
    val informational_status_of_sexp : Sexplib0.Sexp.t -> informational_status
    val __informational_status_of_sexp__ : Sexplib0.Sexp.t -> informational_status
    type success_status = [
    1. | `OK
      (*

      standard response for successful HTTP requests

      *)
    2. | `Created
      (*

      request has been fulfilled; new resource created

      *)
    3. | `Accepted
      (*

      request accepted, processing pending

      *)
    4. | `Non_authoritative_information
      (*

      request processed, information may be from another source

      *)
    5. | `No_content
      (*

      request processed, no content returned

      *)
    6. | `Reset_content
      (*

      request processed, no content returned, reset document view

      *)
    7. | `Partial_content
      (*

      partial resource return due to request header

      *)
    8. | `Multi_status
      (*

      XML, can contain multiple separate responses

      *)
    9. | `Already_reported
      (*

      results previously returned

      *)
    10. | `Im_used
      (*

      request fulfilled, response is instance-manipulations

      *)
    ]

    Success

    val sexp_of_success_status : success_status -> Sexplib0.Sexp.t
    val success_status_of_sexp : Sexplib0.Sexp.t -> success_status
    val __success_status_of_sexp__ : Sexplib0.Sexp.t -> success_status
    type redirection_status = [
    1. | `Multiple_choices
      (*

      multiple options for the resource delivered

      *)
    2. | `Moved_permanently
      (*

      this and all future requests directed to the given URI

      *)
    3. | `Found
      (*

      temporary response to request found via alternative URI

      *)
    4. | `See_other
      (*

      permanent response to request found via alternative URI

      *)
    5. | `Not_modified
      (*

      resource has not been modified since last requested

      *)
    6. | `Use_proxy
      (*

      content located elsewhere, retrieve from there

      *)
    7. | `Switch_proxy
      (*

      subsequent requests should use the specified proxy

      *)
    8. | `Temporary_redirect
      (*

      connect again to different URI as provided

      *)
    9. | `Permanent_redirect
      (*

      connect again to a different URI using the same method

      *)
    ]

    Redirection

    val sexp_of_redirection_status : redirection_status -> Sexplib0.Sexp.t
    val redirection_status_of_sexp : Sexplib0.Sexp.t -> redirection_status
    val __redirection_status_of_sexp__ : Sexplib0.Sexp.t -> redirection_status
    type client_error_status = [
    1. | `Bad_request
      (*

      request cannot be fulfilled due to bad syntax

      *)
    2. | `Unauthorized
      (*

      authentication is possible but has failed

      *)
    3. | `Payment_required
      (*

      payment required, reserved for future use

      *)
    4. | `Forbidden
      (*

      server refuses to respond to request

      *)
    5. | `Not_found
      (*

      requested resource could not be found

      *)
    6. | `Method_not_allowed
      (*

      request method not supported by that resource

      *)
    7. | `Not_acceptable
      (*

      content not acceptable according to the Accept headers

      *)
    8. | `Proxy_authentication_required
      (*

      client must first authenticate itself with the proxy

      *)
    9. | `Request_timeout
      (*

      server timed out waiting for the request

      *)
    10. | `Conflict
      (*

      request could not be processed because of conflict

      *)
    11. | `Gone
      (*

      resource is no longer available and will not be available again

      *)
    12. | `Length_required
      (*

      request did not specify the length of its content

      *)
    13. | `Precondition_failed
      (*

      server does not meet request preconditions

      *)
    14. | `Request_entity_too_large
      (*

      request is larger than the server is willing or able to process

      *)
    15. | `Request_uri_too_long
      (*

      URI provided was too long for the server to process

      *)
    16. | `Unsupported_media_type
      (*

      server does not support media type

      *)
    17. | `Requested_range_not_satisfiable
      (*

      client has asked for unprovidable portion of the file

      *)
    18. | `Expectation_failed
      (*

      server cannot meet requirements of Expect request-header field

      *)
    19. | `I_m_a_teapot
      (*

      I'm a teapot

      *)
    20. | `Enhance_your_calm
      (*

      Twitter rate limiting

      *)
    21. | `Unprocessable_entity
      (*

      request unable to be followed due to semantic errors

      *)
    22. | `Locked
      (*

      resource that is being accessed is locked

      *)
    23. | `Failed_dependency
      (*

      request failed due to failure of a previous request

      *)
    24. | `Upgrade_required
      (*

      client should switch to a different protocol

      *)
    25. | `Precondition_required
      (*

      origin server requires the request to be conditional

      *)
    26. | `Too_many_requests
      (*

      user has sent too many requests in a given amount of time

      *)
    27. | `Request_header_fields_too_large
      (*

      server is unwilling to process the request

      *)
    28. | `No_response
      (*

      server returns no information and closes the connection

      *)
    29. | `Retry_with
      (*

      request should be retried after performing action

      *)
    30. | `Blocked_by_windows_parental_controls
      (*

      Windows Parental Controls blocking access to webpage

      *)
    31. | `Wrong_exchange_server
      (*

      the server cannot reach the client's mailbox

      *)
    32. | `Client_closed_request
      (*

      connection closed by client while HTTP server is processing

      *)
    ]

    Client_error

    val sexp_of_client_error_status : client_error_status -> Sexplib0.Sexp.t
    val client_error_status_of_sexp : Sexplib0.Sexp.t -> client_error_status
    val __client_error_status_of_sexp__ : Sexplib0.Sexp.t -> client_error_status
    type server_error_status = [
    1. | `Internal_server_error
      (*

      generic error message

      *)
    2. | `Not_implemented
      (*

      server does not recognise method or lacks ability to fulfill

      *)
    3. | `Bad_gateway
      (*

      server received an invalid response from upstream server

      *)
    4. | `Service_unavailable
      (*

      server is currently unavailable

      *)
    5. | `Gateway_timeout
      (*

      gateway did not receive response from upstream server

      *)
    6. | `Http_version_not_supported
      (*

      server does not support the HTTP protocol version

      *)
    7. | `Variant_also_negotiates
      (*

      content negotiation for the request results in a circular reference

      *)
    8. | `Insufficient_storage
      (*

      server is unable to store the representation

      *)
    9. | `Loop_detected
      (*

      server detected an infinite loop while processing the request

      *)
    10. | `Bandwidth_limit_exceeded
      (*

      bandwidth limit exceeded

      *)
    11. | `Not_extended
      (*

      further extensions to the request are required

      *)
    12. | `Network_authentication_required
      (*

      client needs to authenticate to gain network access

      *)
    13. | `Network_read_timeout_error
      (*

      network read timeout behind the proxy

      *)
    14. | `Network_connect_timeout_error
      (*

      network connect timeout behind the proxy

      *)
    ]

    Server_error

    val sexp_of_server_error_status : server_error_status -> Sexplib0.Sexp.t
    val server_error_status_of_sexp : Sexplib0.Sexp.t -> server_error_status
    val __server_error_status_of_sexp__ : Sexplib0.Sexp.t -> server_error_status
    val sexp_of_status : status -> Sexplib0.Sexp.t
    val status_of_sexp : Sexplib0.Sexp.t -> status
    val __status_of_sexp__ : Sexplib0.Sexp.t -> status
    type status_code = [
    1. | `Code of int
    2. | status
    ]
    val sexp_of_status_code : status_code -> Sexplib0.Sexp.t
    val status_code_of_sexp : Sexplib0.Sexp.t -> status_code
    val __status_code_of_sexp__ : Sexplib0.Sexp.t -> status_code
    val string_of_version : version -> string

    Convert a version to a string.

    val version_of_string : string -> version

    Convert a string to a version.

    val compare_version : version -> version -> int

    Comparison function for version values

    val string_of_method : meth -> string

    Convert a method to a string.

    val method_of_string : string -> meth

    Convert a string to a method.

    val compare_method : meth -> meth -> int

    Comparison function for method values

    val status_of_code : int -> status_code

    Generate status values from int codes.

    val code_of_status : status_code -> int

    Generate an int code from a status value.

    val string_of_status : status_code -> string

    Give a description of the given status value.

    val reason_phrase_of_code : int -> string

    Give a description of the given int code.

    val is_informational : int -> bool

    Is the given int code belong to the class of "informational" return code ?

    val is_success : int -> bool

    Is the given int code belong to the class of "success" return code ?

    val is_redirection : int -> bool

    Is the given int code belong to the class of "redirection" return code ?

    val is_client_error : int -> bool

    Is the given int code belong to the class of "client_error" return code ?

    val is_server_error : int -> bool

    Is the given int code belong to the class of "server_error" return code ?

    val is_error : int -> bool

    Return true for client and server error status codes.

    diff --git a/cohttp/Cohttp/Conf/index.html b/cohttp/Cohttp/Conf/index.html index a09e8e389..4ab55dc8f 100644 --- a/cohttp/Cohttp/Conf/index.html +++ b/cohttp/Cohttp/Conf/index.html @@ -1,2 +1,2 @@ -Conf (cohttp.Cohttp.Conf)

    Module Cohttp.Conf

    Compile-time configuration variables

    val version : string

    The version number of this library.

    +Conf (cohttp.Cohttp.Conf)

    Module Cohttp.Conf

    Compile-time configuration variables

    val version : string

    The version number of this library.

    diff --git a/cohttp/Cohttp/Connection/index.html b/cohttp/Cohttp/Connection/index.html index b1a46c8be..ebe8a58f7 100644 --- a/cohttp/Cohttp/Connection/index.html +++ b/cohttp/Cohttp/Connection/index.html @@ -1,2 +1,2 @@ -Connection (cohttp.Cohttp.Connection)

    Module Cohttp.Connection

    • deprecated Connection.t values are useless.

    Connection identifiers.

    type t

    Abstract type for connection identifiers.

    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val create : unit -> t

    Create a fresh connection identifier.

    val to_string : t -> string

    Pretty-print a connection identifer.

    val compare : t -> t -> int

    Comparison function for two identifiers. More recently constructed identifiers will be greater than older ones.

    +Connection (cohttp.Cohttp.Connection)

    Module Cohttp.Connection

    • deprecated Connection.t values are useless.

    Connection identifiers.

    type t

    Abstract type for connection identifiers.

    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val create : unit -> t

    Create a fresh connection identifier.

    val to_string : t -> string

    Pretty-print a connection identifier.

    val compare : t -> t -> int

    Comparison function for two identifiers. More recently constructed identifiers will be greater than older ones.

    diff --git a/cohttp/Cohttp/Cookie/Cookie_hdr/index.html b/cohttp/Cohttp/Cookie/Cookie_hdr/index.html index 2515297b0..35a41ee50 100644 --- a/cohttp/Cohttp/Cookie/Cookie_hdr/index.html +++ b/cohttp/Cohttp/Cookie/Cookie_hdr/index.html @@ -1,2 +1,2 @@ -Cookie_hdr (cohttp.Cohttp.Cookie.Cookie_hdr)

    Module Cookie.Cookie_hdr

    val extract : Header.t -> cookie list

    Return the list of cookies sent by the client

    val serialize : cookie list -> string * string

    serialize cookies returns an HTTP header containing cookies

    +Cookie_hdr (cohttp.Cohttp.Cookie.Cookie_hdr)

    Module Cookie.Cookie_hdr

    val extract : Header.t -> cookie list

    Return the list of cookies sent by the client

    val serialize : cookie list -> string * string

    serialize cookies returns an HTTP header containing cookies

    diff --git a/cohttp/Cohttp/Cookie/Set_cookie_hdr/index.html b/cohttp/Cohttp/Cookie/Set_cookie_hdr/index.html index b2618991b..d8c222ee3 100644 --- a/cohttp/Cohttp/Cookie/Set_cookie_hdr/index.html +++ b/cohttp/Cohttp/Cookie/Set_cookie_hdr/index.html @@ -1,5 +1,5 @@ -Set_cookie_hdr (cohttp.Cohttp.Cookie.Set_cookie_hdr)

    Module Cookie.Set_cookie_hdr

    type t = {
    1. cookie : cookie;
    2. expiration : expiration;
    3. domain : string option;
    4. path : string option;
    5. secure : bool;
    6. http_only : bool;
    }

    A header which a server sends to a client to request that the client returns the cookie in future requests, under certain conditions.

    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val make : +Set_cookie_hdr (cohttp.Cohttp.Cookie.Set_cookie_hdr)

    Module Cookie.Set_cookie_hdr

    type t = {
    1. cookie : cookie;
    2. expiration : expiration;
    3. domain : string option;
    4. path : string option;
    5. secure : bool;
    6. http_only : bool;
    }

    A header which a server sends to a client to request that the client returns the cookie in future requests, under certain conditions.

    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val make : ?expiration:expiration -> ?path:string -> ?domain:string -> diff --git a/cohttp/Cohttp/Cookie/index.html b/cohttp/Cohttp/Cookie/index.html index 4cf2e687a..2016aca12 100644 --- a/cohttp/Cohttp/Cookie/index.html +++ b/cohttp/Cohttp/Cookie/index.html @@ -1,2 +1,2 @@ -Cookie (cohttp.Cohttp.Cookie)

    Module Cohttp.Cookie

    Functions for the HTTP Cookie and Set-Cookie header fields. Using the Set-Cookie header field, an HTTP server can pass name/value pairs and associated metadata (called cookies) to a user agent. When the user agent makes subsequent requests to the server, the user agent uses the metadata and other information to determine whether to return the name/value pairs in the Cookie header.

    type expiration = [
    1. | `Session
      (*

      Instructs the user agent to discard the cookie unconditionally when the user agent terminates.

      *)
    2. | `Max_age of int64
      (*

      The value of the Max-Age attribute is delta-seconds, the lifetime of the cookie in seconds, a decimal non-negative integer.

      *)
    ]

    Lifetime of the cookie after which the user agent discards it

    val sexp_of_expiration : expiration -> Sexplib0.Sexp.t
    val expiration_of_sexp : Sexplib0.Sexp.t -> expiration
    val __expiration_of_sexp__ : Sexplib0.Sexp.t -> expiration

    A cookie is simply a key/value pair send from the client to the server

    +Cookie (cohttp.Cohttp.Cookie)

    Module Cohttp.Cookie

    Functions for the HTTP Cookie and Set-Cookie header fields. Using the Set-Cookie header field, an HTTP server can pass name/value pairs and associated metadata (called cookies) to a user agent. When the user agent makes subsequent requests to the server, the user agent uses the metadata and other information to determine whether to return the name/value pairs in the Cookie header.

    type expiration = [
    1. | `Session
      (*

      Instructs the user agent to discard the cookie unconditionally when the user agent terminates.

      *)
    2. | `Max_age of int64
      (*

      The value of the Max-Age attribute is delta-seconds, the lifetime of the cookie in seconds, a decimal non-negative integer.

      *)
    ]

    Lifetime of the cookie after which the user agent discards it

    val sexp_of_expiration : expiration -> Sexplib0.Sexp.t
    val expiration_of_sexp : Sexplib0.Sexp.t -> expiration
    val __expiration_of_sexp__ : Sexplib0.Sexp.t -> expiration

    A cookie is simply a key/value pair send from the client to the server

    diff --git a/cohttp/Cohttp/Generic/Client/Make/argument-1-Base/index.html b/cohttp/Cohttp/Generic/Client/Make/argument-1-Base/index.html index c9fd60dca..3e769d7aa 100644 --- a/cohttp/Cohttp/Generic/Client/Make/argument-1-Base/index.html +++ b/cohttp/Cohttp/Generic/Client/Make/argument-1-Base/index.html @@ -1,5 +1,5 @@ -Base (cohttp.Cohttp.Generic.Client.Make.Base)

    Parameter Make.Base

    type +'a io
    type 'a with_context
    type body
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : +Base (cohttp.Cohttp.Generic.Client.Make.Base)

    Parameter Make.Base

    type +'a io
    type 'a with_context
    type body
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : (?headers:Http.Header.t -> ?body:body -> ?chunked:bool -> diff --git a/cohttp/Cohttp/Generic/Client/Make/argument-2-IO/index.html b/cohttp/Cohttp/Generic/Client/Make/argument-2-IO/index.html index 2054d8df3..b0e906dd0 100644 --- a/cohttp/Cohttp/Generic/Client/Make/argument-2-IO/index.html +++ b/cohttp/Cohttp/Generic/Client/Make/argument-2-IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp.Cohttp.Generic.Client.Make.IO)

    Parameter Make.IO

    type 'a t = 'a Base.io

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp.Cohttp.Generic.Client.Make.IO)

    Parameter Make.IO

    type 'a t = 'a Base.io

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    diff --git a/cohttp/Cohttp/Generic/Client/Make/index.html b/cohttp/Cohttp/Generic/Client/Make/index.html index a7f26e964..ceed11831 100644 --- a/cohttp/Cohttp/Generic/Client/Make/index.html +++ b/cohttp/Cohttp/Generic/Client/Make/index.html @@ -1,5 +1,5 @@ -Make (cohttp.Cohttp.Generic.Client.Make)

    Module Client.Make

    Parameters

    module Base : BASE
    module IO : S.IO with type 'a t = 'a Base.io

    Signature

    include module type of struct include Base end
    type +'a io = 'a Base.io
    type 'a with_context = 'a Base.with_context
    type body = Base.body
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : +Make (cohttp.Cohttp.Generic.Client.Make)

    Module Client.Make

    Parameters

    module Base : BASE
    module IO : S.IO with type 'a t = 'a Base.io

    Signature

    include module type of struct include Base end
    type +'a io = 'a Base.io
    type 'a with_context = 'a Base.with_context
    type body = Base.body
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : (?headers:Http.Header.t -> ?body:body -> ?chunked:bool -> diff --git a/cohttp/Cohttp/Generic/Client/index.html b/cohttp/Cohttp/Generic/Client/index.html index 856c01c72..5aa20bf9c 100644 --- a/cohttp/Cohttp/Generic/Client/index.html +++ b/cohttp/Cohttp/Generic/Client/index.html @@ -1,2 +1,2 @@ -Client (cohttp.Cohttp.Generic.Client)

    Module Generic.Client

    module type BASE = sig ... end

    The Client module is a collection of convenience functions for constructing and processing requests.

    module type S = sig ... end
    module Make (Base : BASE) (IO : S.IO with type 'a t = 'a Base.io) : sig ... end
    +Client (cohttp.Cohttp.Generic.Client)

    Module Generic.Client

    module type BASE = sig ... end

    The Client module is a collection of convenience functions for constructing and processing requests.

    module type S = sig ... end
    module Make (Base : BASE) (IO : S.IO with type 'a t = 'a Base.io) : sig ... end
    diff --git a/cohttp/Cohttp/Generic/Client/module-type-BASE/index.html b/cohttp/Cohttp/Generic/Client/module-type-BASE/index.html index 725c13b12..967281a40 100644 --- a/cohttp/Cohttp/Generic/Client/module-type-BASE/index.html +++ b/cohttp/Cohttp/Generic/Client/module-type-BASE/index.html @@ -1,5 +1,5 @@ -BASE (cohttp.Cohttp.Generic.Client.BASE)

    Module type Client.BASE

    The Client module is a collection of convenience functions for constructing and processing requests.

    type +'a io
    type 'a with_context
    type body
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : +BASE (cohttp.Cohttp.Generic.Client.BASE)

    Module type Client.BASE

    The Client module is a collection of convenience functions for constructing and processing requests.

    type +'a io
    type 'a with_context
    type body
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : (?headers:Http.Header.t -> ?body:body -> ?chunked:bool -> diff --git a/cohttp/Cohttp/Generic/Client/module-type-S/index.html b/cohttp/Cohttp/Generic/Client/module-type-S/index.html index 948edd06d..d6aae9de9 100644 --- a/cohttp/Cohttp/Generic/Client/module-type-S/index.html +++ b/cohttp/Cohttp/Generic/Client/module-type-S/index.html @@ -1,5 +1,5 @@ -S (cohttp.Cohttp.Generic.Client.S)

    Module type Client.S

    include BASE
    type +'a io
    type 'a with_context
    type body
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : +S (cohttp.Cohttp.Generic.Client.S)

    Module type Client.S

    include BASE
    type +'a io
    type 'a with_context
    type body
    val map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
    val call : (?headers:Http.Header.t -> ?body:body -> ?chunked:bool -> diff --git a/cohttp/Cohttp/Generic/Server/index.html b/cohttp/Cohttp/Generic/Server/index.html index 6a6dc72e8..37e2901f5 100644 --- a/cohttp/Cohttp/Generic/Server/index.html +++ b/cohttp/Cohttp/Generic/Server/index.html @@ -1,2 +1,2 @@ -Server (cohttp.Cohttp.Generic.Server)

    Module Generic.Server

    module type S = sig ... end
    +Server (cohttp.Cohttp.Generic.Server)

    Module Generic.Server

    module type S = sig ... end
    diff --git a/cohttp/Cohttp/Generic/Server/module-type-S/IO/index.html b/cohttp/Cohttp/Generic/Server/module-type-S/IO/index.html index 02c364386..528c0c1d4 100644 --- a/cohttp/Cohttp/Generic/Server/module-type-S/IO/index.html +++ b/cohttp/Cohttp/Generic/Server/module-type-S/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp.Cohttp.Generic.Server.S.IO)

    Module S.IO

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp.Cohttp.Generic.Server.S.IO)

    Module S.IO

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    diff --git a/cohttp/Cohttp/Generic/Server/module-type-S/index.html b/cohttp/Cohttp/Generic/Server/module-type-S/index.html index 070d151d5..306b193bf 100644 --- a/cohttp/Cohttp/Generic/Server/module-type-S/index.html +++ b/cohttp/Cohttp/Generic/Server/module-type-S/index.html @@ -1,5 +1,5 @@ -S (cohttp.Cohttp.Generic.Server.S)

    Module type Server.S

    module IO : S.IO
    type body
    type conn = IO.conn * Connection.t
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of Http.Response.t * body
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unitIO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : +S (cohttp.Cohttp.Generic.Server.S)

    Module type Server.S

    module IO : S.IO
    type body
    type conn = IO.conn * Connection.t
    type response
    type response_action = [
    1. | `Expert of Http.Response.t * (IO.ic -> IO.oc -> unit IO.t)
    2. | `Response of response
    ]

    A request handler can respond in two ways:

    • Using `Response, with a Response.t and a body.
    • Using `Expert, with a Response.t and an IO function that is expected to write the response body. The IO function has access to the underlying IO.ic and IO.oc, which allows writing a response body more efficiently, stream a response or to switch protocols entirely (e.g. websockets). Processing of pipelined requests continue after the unit IO.t is resolved. The connection can be closed by closing the IO.ic.
    type t
    val make_response_action : ?conn_closed:(conn -> unit) -> callback:(conn -> Http.Request.t -> body -> response_action IO.t) -> unit -> @@ -13,18 +13,16 @@ unit -> t
    val make : ?conn_closed:(conn -> unit) -> - callback:(conn -> Http.Request.t -> body -> (Http.Response.t * body) IO.t) -> + callback:(conn -> Http.Request.t -> body -> response IO.t) -> unit -> t
    val respond : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> body:body -> unit -> - (Http.Response.t * body) IO.t

    respond ?headers ?flush ~status ~body will respond to an HTTP request with the given status code and response body. If flush is true, then every response chunk will be flushed to the network rather than being buffered. flush is true by default. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : + response IO.t

    respond ?headers ~status ~body will respond to an HTTP request with the given status code and response body. The transfer encoding will be detected from the body value and set to chunked encoding if it cannot be determined immediately. You can override the encoding by supplying an appropriate Content-length or Transfer-encoding in the headers parameter.

    val respond_string : ?headers:Http.Header.t -> - ?flush:bool -> status:Http.Status.t -> body:string -> unit -> - (Http.Response.t * body) IO.t
    val callback : t -> IO.conn -> IO.ic -> IO.oc -> unit IO.t
    + response IO.t
    val callback : t -> IO.conn -> IO.ic -> IO.oc -> unit IO.t
    diff --git a/cohttp/Cohttp/Generic/index.html b/cohttp/Cohttp/Generic/index.html index 34b438a5c..258438834 100644 --- a/cohttp/Cohttp/Generic/index.html +++ b/cohttp/Cohttp/Generic/index.html @@ -1,2 +1,2 @@ -Generic (cohttp.Cohttp.Generic)

    Module Cohttp.Generic

    module Client : sig ... end
    module Server : sig ... end
    +Generic (cohttp.Cohttp.Generic)

    Module Cohttp.Generic

    module Client : sig ... end
    module Server : sig ... end
    diff --git a/cohttp/Cohttp/Header/Private/index.html b/cohttp/Cohttp/Header/Private/index.html index eaa7b1b73..794f514cb 100644 --- a/cohttp/Cohttp/Header/Private/index.html +++ b/cohttp/Cohttp/Header/Private/index.html @@ -1,2 +1,2 @@ -Private (cohttp.Cohttp.Header.Private)

    Module Header.Private

    val caseless_equal : string -> string -> bool

    caseless_equal a b must be equivalent to String.equal (String.lowercase_ascii a) (String.lowercase_ascii b).

    +Private (cohttp.Cohttp.Header.Private)

    Module Header.Private

    val caseless_equal : string -> string -> bool

    caseless_equal a b must be equivalent to String.equal (String.lowercase_ascii a) (String.lowercase_ascii b).

    diff --git a/cohttp/Cohttp/Header/index.html b/cohttp/Cohttp/Header/index.html index 505112d47..7880f322d 100644 --- a/cohttp/Cohttp/Header/index.html +++ b/cohttp/Cohttp/Header/index.html @@ -1,5 +1,5 @@ -Header (cohttp.Cohttp.Header)

    Module Cohttp.Header

    Associative list representing HTTP headers. Order of transmission is preserved, which implies that headers with same name are neither removed or concataned by default (see clean_dup to do that).

    The type for HTTP headers.

    include module type of Http.Header with type t = Http.Header.t
    type t = Http.Header.t

    Associative list representing HTTP headers. Order of transmission is preserved, which implies that headers with same name are neither removed or concataned by default (see clean_dup to do that).

    The type for HTTP headers.

    val iter_ord : (string -> string -> unit) -> t -> unit

    iter_ord f h applies f to all the headers of h following the header order.

    module Private : sig ... end
    val sexp_of_t : t -> Sexplib0.Sexp.t
    val t_of_sexp : Sexplib0.Sexp.t -> t
    val init : unit -> t

    init () constructs a fresh, empty list of HTTP headers.

    val is_empty : t -> bool

    is_empty h tests whether HTTP headers h are empty or not.

    val of_list_rev : (string * string) list -> t
    val of_list : (string * string) list -> t

    of_list l construct a fresh headers from the content of l and in same order. to_list and of_list are defined such as to_list (of_list l) = l is true with case insensitive comparison.

    val to_list : t -> (string * string) list

    to_list h converts HTTP headers h to a list. Order and case is preserved.

    Invariant (with case insensitive comparison): to_list (of_list l) = l

    val init_with : string -> string -> t

    init_with k v construct a fresh HTTP headers with a single header with name k and value v.

    val add : t -> string -> string -> t

    add h k v adds the header name k and it associated value v at the end of header list h.

    val add_list : t -> (string * string) list -> t

    add_list h l adds in order all header pairs contained in l to the header list h.

    Invariant (with case insensitive comparison): to_list (add_list h l) = to_list h @ l

    val add_multi : t -> string -> string list -> t

    add_multi h k vs add multiple header pairs with same name h and values contained in vs in h. The new headers are in the same order that in vs.

    Invariant: get_multi (add_multi h k vs) k = (get_multi h k) @ vs

    val add_opt : t option -> string -> string -> t

    add_opt hopt k v adds the header (k, v) to h if hopt is Some h, or constructs a fresh header list containing this single header if hopt is None.

    val add_unless_exists : t -> string -> string -> t

    add_unless_exists h k v adds (k, v) to h unless the header name k is already present in the header.

    val add_opt_unless_exists : t option -> string -> string -> t

    add_opt_unless_exists h k v adds (k, v) to h if hopt is Some h unless the header name k is already present in the headers. If h is None then a fresh header list is constructed containing the header (k, v).

    val remove : t -> string -> t

    remove h k removes every values associated to the header name k from h.

    val replace : t -> string -> string -> t

    replace h k v replaces the last added value of k from h and removed all other occurences of k if it exists. Otherwise it adds (k, v) to h.

    Invariant: forall h, k, v. get_multi (replace h k v) = [ v ]

    val mem : t -> string -> bool

    mem h k returns true if the header name k appears in h and false otherwise.

    val compare : t -> t -> int

    compare h h' is the structural comparison of two Header values.

    val get : t -> string -> string option

    get h k returns Some v where v is the last added value associated with k in h if it exists and None otherwise

    val get_multi : t -> string -> string list

    get_multi h k returns a list of all values associated with k in h in order they appear in it.

    val get_multi_concat : ?list_value_only:bool -> t -> string -> string option

    get_multi_concat h k returns Some v if there is at least one value associated with k in h and None otherwise. v is the concatenation of all values paired with k in h, separated by a comma and in order they appear in h.

    The optional argument ?list_value_only is false by default. If it is true and there is at least one value associated to k, the returned value is the concatenated values only if k is a header that can have multiple values (like transfer-encoding or accept). Otherwise, the returned value is the last value paired with k in h.

    Invariant: forall h, k not a list-value header. get_multi_concat ~list-value-only:true h k = get h k

    val update : t -> string -> (string option -> string option) -> t

    update h k f returns an header list containing the same headers as h, except for the header name k. Depending on the value of v where v is f (get h k), the header pair (k, v) is added, removed or updated.

    • If v is None, the last occurence of k in h is removed;
    • If v is Some w then the last value paired with k in h is replaced by w if it exists. Otherwise, the pair (k, w) is added;
    • If k was already associated last in h to a value that is physically equal to w, h is returned unchanged.
    val update_all : t -> string -> (string list -> string list) -> t

    update_all h k f returns an header list containing the same headers as h, except for the header k. Depending on the list of values vs where vs is f (get_multi h k), the values associated to the header k are added, removed or updated.

    • If vs is an empty list, every occurences of the header k in h are removed;
    • If vs is a non-empty list, all values previously associated to k are removed and all values in vs are added with add_multi;
    • If k was already associated in h to a list that is equal to vs, h is returned unchanged.
    val iter : (string -> string -> unit) -> t -> unit
    val map : (string -> string -> string) -> t -> t
    val fold : (string -> string -> 'a -> 'a) -> t -> 'a -> 'a
    val to_lines : t -> string list

    to_lines h returns header fieds as a list of lines. Beware that each line ends with "\r\n" characters.

    val to_frames : t -> string list

    to_frames h returns the same as to_lines but lines do not end with "\r\n" characters.

    val to_string : t -> string
    val clean_dup : t -> t

    clean_dup h cleans duplicates in h following RFC7230§3.2.2; if a duplicated header can not have multiple values, only the last value is kept in place. Otherwise, the values are concatenated and place at the first position the header is encountered in h.

    Already concatenated values (like anhost.com, anotherhost.com in the example below) are not affected by clean_dup. For example,

        transfer-encoding: gzip
    +Header (cohttp.Cohttp.Header)

    Module Cohttp.Header

    Associative list representing HTTP headers. Order of transmission is preserved, which implies that headers with same name are neither removed or concataned by default (see clean_dup to do that).

    The type for HTTP headers.

    include module type of Http.Header with type t = Http.Header.t
    type t = Http.Header.t

    Associative list representing HTTP headers. Order of transmission is preserved, which implies that headers with same name are neither removed or concataned by default (see clean_dup to do that).

    The type for HTTP headers.

    val iter_ord : (string -> string -> unit) -> t -> unit

    iter_ord f h applies f to all the headers of h following the header order.

    module Private : sig ... end
    val sexp_of_t : t -> Sexplib0.Sexp.t
    val t_of_sexp : Sexplib0.Sexp.t -> t
    val init : unit -> t

    init () constructs a fresh, empty list of HTTP headers.

    val is_empty : t -> bool

    is_empty h tests whether HTTP headers h are empty or not.

    val of_list_rev : (string * string) list -> t
    val of_list : (string * string) list -> t

    of_list l construct a fresh headers from the content of l and in same order. to_list and of_list are defined such as to_list (of_list l) = l is true with case insensitive comparison.

    val to_list : t -> (string * string) list

    to_list h converts HTTP headers h to a list. Order and case is preserved.

    Invariant (with case insensitive comparison): to_list (of_list l) = l

    val init_with : string -> string -> t

    init_with k v construct a fresh HTTP headers with a single header with name k and value v.

    val add : t -> string -> string -> t

    add h k v adds the header name k and it associated value v at the end of header list h.

    val add_list : t -> (string * string) list -> t

    add_list h l adds in order all header pairs contained in l to the header list h.

    Invariant (with case insensitive comparison): to_list (add_list h l) = to_list h @ l

    val add_multi : t -> string -> string list -> t

    add_multi h k vs add multiple header pairs with same name h and values contained in vs in h. The new headers are in the same order that in vs.

    Invariant: get_multi (add_multi h k vs) k = (get_multi h k) @ vs

    val add_opt : t option -> string -> string -> t

    add_opt hopt k v adds the header (k, v) to h if hopt is Some h, or constructs a fresh header list containing this single header if hopt is None.

    val add_unless_exists : t -> string -> string -> t

    add_unless_exists h k v adds (k, v) to h unless the header name k is already present in the header.

    val add_opt_unless_exists : t option -> string -> string -> t

    add_opt_unless_exists h k v adds (k, v) to h if hopt is Some h unless the header name k is already present in the headers. If h is None then a fresh header list is constructed containing the header (k, v).

    val remove : t -> string -> t

    remove h k removes every values associated to the header name k from h.

    val replace : t -> string -> string -> t

    replace h k v replaces the last added value of k from h and removed all other occurrences of k if it exists. Otherwise it adds (k, v) to h.

    Invariant: forall h, k, v. get_multi (replace h k v) = [ v ]

    val mem : t -> string -> bool

    mem h k returns true if the header name k appears in h and false otherwise.

    val compare : t -> t -> int

    compare h h' is the structural comparison of two Header values.

    val get : t -> string -> string option

    get h k returns Some v where v is the last added value associated with k in h if it exists and None otherwise

    val get_multi : t -> string -> string list

    get_multi h k returns a list of all values associated with k in h in order they appear in it.

    val get_multi_concat : ?list_value_only:bool -> t -> string -> string option

    get_multi_concat h k returns Some v if there is at least one value associated with k in h and None otherwise. v is the concatenation of all values paired with k in h, separated by a comma and in order they appear in h.

    The optional argument ?list_value_only is false by default. If it is true and there is at least one value associated to k, the returned value is the concatenated values only if k is a header that can have multiple values (like transfer-encoding or accept). Otherwise, the returned value is the last value paired with k in h.

    Invariant: forall h, k not a list-value header. get_multi_concat ~list-value-only:true h k = get h k

    val update : t -> string -> (string option -> string option) -> t

    update h k f returns an header list containing the same headers as h, except for the header name k. Depending on the value of v where v is f (get h k), the header pair (k, v) is added, removed or updated.

    • If v is None, the last occurrence of k in h is removed;
    • If v is Some w then the last value paired with k in h is replaced by w if it exists. Otherwise, the pair (k, w) is added;
    • If k was already associated last in h to a value that is physically equal to w, h is returned unchanged.
    val update_all : t -> string -> (string list -> string list) -> t

    update_all h k f returns an header list containing the same headers as h, except for the header k. Depending on the list of values vs where vs is f (get_multi h k), the values associated to the header k are added, removed or updated.

    • If vs is an empty list, every occurrences of the header k in h are removed;
    • If vs is a non-empty list, all values previously associated to k are removed and all values in vs are added with add_multi;
    • If k was already associated in h to a list that is equal to vs, h is returned unchanged.
    val iter : (string -> string -> unit) -> t -> unit
    val map : (string -> string -> string) -> t -> t
    val fold : (string -> string -> 'a -> 'a) -> t -> 'a -> 'a
    val to_lines : t -> string list

    to_lines h returns header fields as a list of lines. Beware that each line ends with "\r\n" characters.

    val to_frames : t -> string list

    to_frames h returns the same as to_lines but lines do not end with "\r\n" characters.

    val to_string : t -> string
    val clean_dup : t -> t

    clean_dup h cleans duplicates in h following RFC7230§3.2.2; if a duplicated header can not have multiple values, only the last value is kept in place. Otherwise, the values are concatenated and place at the first position the header is encountered in h.

    Already concatenated values (like anhost.com, anotherhost.com in the example below) are not affected by clean_dup. For example,

        transfer-encoding: gzip
         host: afirsthost.com
         connection: keep-alive
         host: anhost.com, anotherhost.com
    diff --git a/cohttp/Cohttp/Link/Arc/index.html b/cohttp/Cohttp/Link/Arc/index.html
    index 1051b0521..621fb2c4e 100644
    --- a/cohttp/Cohttp/Link/Arc/index.html
    +++ b/cohttp/Cohttp/Link/Arc/index.html
    @@ -1,2 +1,2 @@
     
    -Arc (cohttp.Cohttp.Link.Arc)

    Module Link.Arc

    type t = {
    1. reverse : bool;
    2. relation : Rel.t list;
    3. hreflang : string option;
    4. media : string option;
    5. title : string option;
    6. title_ext : string Ext.t option;
    7. media_type : (string * string) option;
    8. extensions : (string * string) list;
    9. extension_exts : (string * string Ext.t) list;
    }
    val empty : t
    +Arc (cohttp.Cohttp.Link.Arc)

    Module Link.Arc

    type t = {
    1. reverse : bool;
    2. relation : Rel.t list;
    3. hreflang : string option;
    4. media : string option;
    5. title : string option;
    6. title_ext : string Ext.t option;
    7. media_type : (string * string) option;
    8. extensions : (string * string) list;
    9. extension_exts : (string * string Ext.t) list;
    }
    val empty : t
    diff --git a/cohttp/Cohttp/Link/Charset/index.html b/cohttp/Cohttp/Link/Charset/index.html index 541840f5c..602ede4da 100644 --- a/cohttp/Cohttp/Link/Charset/index.html +++ b/cohttp/Cohttp/Link/Charset/index.html @@ -1,2 +1,2 @@ -Charset (cohttp.Cohttp.Link.Charset)

    Module Link.Charset

    type t = private string
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val to_string : t -> string
    val of_string : string -> t
    +Charset (cohttp.Cohttp.Link.Charset)

    Module Link.Charset

    type t = private string
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val to_string : t -> string
    val of_string : string -> t
    diff --git a/cohttp/Cohttp/Link/Ext/index.html b/cohttp/Cohttp/Link/Ext/index.html index 1dadb8400..7f3f47c34 100644 --- a/cohttp/Cohttp/Link/Ext/index.html +++ b/cohttp/Cohttp/Link/Ext/index.html @@ -1,2 +1,2 @@ -Ext (cohttp.Cohttp.Link.Ext)

    Module Link.Ext

    type 'a t
    include Sexplib0.Sexpable.S1 with type 'a t := 'a t
    val t_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> Sexplib0__.Sexp.t -> 'a t
    val sexp_of_t : ('a -> Sexplib0__.Sexp.t) -> 'a t -> Sexplib0__.Sexp.t
    val charset : 'a t -> Charset.t
    val language : 'a t -> Language.t
    val value : 'a t -> 'a
    val make : ?charset:Charset.t -> ?language:Language.t -> 'a -> 'a t
    val map : ('a -> 'b) -> 'a t -> 'b t
    +Ext (cohttp.Cohttp.Link.Ext)

    Module Link.Ext

    type 'a t
    include Sexplib0.Sexpable.S1 with type 'a t := 'a t
    val t_of_sexp : (Sexplib0__.Sexp.t -> 'a) -> Sexplib0__.Sexp.t -> 'a t
    val sexp_of_t : ('a -> Sexplib0__.Sexp.t) -> 'a t -> Sexplib0__.Sexp.t
    val charset : 'a t -> Charset.t
    val language : 'a t -> Language.t
    val value : 'a t -> 'a
    val make : ?charset:Charset.t -> ?language:Language.t -> 'a -> 'a t
    val map : ('a -> 'b) -> 'a t -> 'b t
    diff --git a/cohttp/Cohttp/Link/Language/index.html b/cohttp/Cohttp/Link/Language/index.html index a4acc38a8..bb38cfe34 100644 --- a/cohttp/Cohttp/Link/Language/index.html +++ b/cohttp/Cohttp/Link/Language/index.html @@ -1,2 +1,2 @@ -Language (cohttp.Cohttp.Link.Language)

    Module Link.Language

    type t = private string
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val to_string : t -> string
    val of_string : string -> t
    +Language (cohttp.Cohttp.Link.Language)

    Module Link.Language

    type t = private string
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val to_string : t -> string
    val of_string : string -> t
    diff --git a/cohttp/Cohttp/Link/Rel/index.html b/cohttp/Cohttp/Link/Rel/index.html index cb88ee5db..b8d86bc25 100644 --- a/cohttp/Cohttp/Link/Rel/index.html +++ b/cohttp/Cohttp/Link/Rel/index.html @@ -1,2 +1,2 @@ -Rel (cohttp.Cohttp.Link.Rel)

    Module Link.Rel

    type t
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val extension : Uri.t -> t
    val alternate : t
    val appendix : t
    val bookmark : t
    val chapter : t
    val contents : t
    val current : t
    val described_by : t
    val edit : t
    val edit_media : t
    val enclosure : t
    val first : t
    val glossary : t
    val help : t
    val hub : t
    val index : t
    val last : t
    val latest_version : t
    val license : t
    val next : t
    val next_archive : t
    val payment : t
    val predecessor_version : t
    val prev : t
    val prev_archive : t
    val replies : t
    val section : t
    val self : t
    val service : t
    val start : t
    val stylesheet : t
    val subsection : t
    val successor_version : t
    val up : t
    val version_history : t
    val via : t
    val working_copy : t
    val working_copy_of : t
    +Rel (cohttp.Cohttp.Link.Rel)

    Module Link.Rel

    type t
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val extension : Uri.t -> t
    val alternate : t
    val appendix : t
    val bookmark : t
    val chapter : t
    val contents : t
    val current : t
    val described_by : t
    val edit : t
    val edit_media : t
    val enclosure : t
    val first : t
    val glossary : t
    val help : t
    val hub : t
    val index : t
    val last : t
    val latest_version : t
    val license : t
    val next : t
    val next_archive : t
    val payment : t
    val predecessor_version : t
    val prev : t
    val prev_archive : t
    val replies : t
    val section : t
    val self : t
    val service : t
    val start : t
    val stylesheet : t
    val subsection : t
    val successor_version : t
    val up : t
    val version_history : t
    val via : t
    val working_copy : t
    val working_copy_of : t
    diff --git a/cohttp/Cohttp/Link/index.html b/cohttp/Cohttp/Link/index.html index d4b587bf9..813ff176f 100644 --- a/cohttp/Cohttp/Link/index.html +++ b/cohttp/Cohttp/Link/index.html @@ -1,2 +1,2 @@ -Link (cohttp.Cohttp.Link)

    Module Cohttp.Link

    RFC 5988 ("Web Linking") and RFC 5987 ("Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters")

    module Rel : sig ... end
    module Language : sig ... end
    module Charset : sig ... end
    module Ext : sig ... end
    module Arc : sig ... end
    type t = {
    1. context : Uri.t;
    2. arc : Arc.t;
    3. target : Uri.t;
    }
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val empty : t
    val of_string : string -> t list
    val to_string : t -> string
    +Link (cohttp.Cohttp.Link)

    Module Cohttp.Link

    RFC 5988 ("Web Linking") and RFC 5987 ("Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters")

    module Rel : sig ... end
    module Language : sig ... end
    module Charset : sig ... end
    module Ext : sig ... end
    module Arc : sig ... end
    type t = {
    1. context : Uri.t;
    2. arc : Arc.t;
    3. target : Uri.t;
    }
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val empty : t
    val of_string : string -> t list
    val to_string : t -> string
    diff --git a/cohttp/Cohttp/Path/index.html b/cohttp/Cohttp/Path/index.html index 565fd3e05..8dc820fa6 100644 --- a/cohttp/Cohttp/Path/index.html +++ b/cohttp/Cohttp/Path/index.html @@ -1,2 +1,2 @@ -Path (cohttp.Cohttp.Path)

    Module Cohttp.Path

    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve the given URI to a local file in the given docroot.

    This decodes and normalises the Uri. It strips out .. characters so that the request will not escape the docroot. The returned filepath is fully qualified iff the given docroot is fully qualified.

    +Path (cohttp.Cohttp.Path)

    Module Cohttp.Path

    val resolve_local_file : docroot:string -> uri:Uri.t -> string

    Resolve the given URI to a local file in the given docroot.

    This decodes and normalises the Uri. It strips out .. characters so that the request will not escape the docroot. The returned filepath is fully qualified iff the given docroot is fully qualified.

    diff --git a/cohttp/Cohttp/Private/Header_io/Make/argument-1-IO/index.html b/cohttp/Cohttp/Private/Header_io/Make/argument-1-IO/index.html index a14d1408d..9b524a391 100644 --- a/cohttp/Cohttp/Private/Header_io/Make/argument-1-IO/index.html +++ b/cohttp/Cohttp/Private/Header_io/Make/argument-1-IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp.Cohttp.Private.Header_io.Make.IO)

    Parameter Make.IO

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp.Cohttp.Private.Header_io.Make.IO)

    Parameter Make.IO

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    diff --git a/cohttp/Cohttp/Private/Header_io/Make/index.html b/cohttp/Cohttp/Private/Header_io/Make/index.html index 1e3527995..9fd934c0a 100644 --- a/cohttp/Cohttp/Private/Header_io/Make/index.html +++ b/cohttp/Cohttp/Private/Header_io/Make/index.html @@ -1,2 +1,2 @@ -Make (cohttp.Cohttp.Private.Header_io.Make)

    Module Header_io.Make

    Parameters

    module IO : S.IO

    Signature

    val parse : IO.ic -> Header.t IO.t
    val write : Header.t -> IO.oc -> unit IO.t
    +Make (cohttp.Cohttp.Private.Header_io.Make)

    Module Header_io.Make

    Parameters

    module IO : S.IO

    Signature

    val parse : IO.ic -> Header.t IO.t
    val write : Header.t -> IO.oc -> unit IO.t
    diff --git a/cohttp/Cohttp/Private/Header_io/index.html b/cohttp/Cohttp/Private/Header_io/index.html index 6b84a98af..90b3b85f1 100644 --- a/cohttp/Cohttp/Private/Header_io/index.html +++ b/cohttp/Cohttp/Private/Header_io/index.html @@ -1,2 +1,2 @@ -Header_io (cohttp.Cohttp.Private.Header_io)

    Module Private.Header_io

    module Make (IO : S.IO) : sig ... end
    +Header_io (cohttp.Cohttp.Private.Header_io)

    Module Private.Header_io

    module Make (IO : S.IO) : sig ... end
    diff --git a/cohttp/Cohttp/Private/String_io/M/index.html b/cohttp/Cohttp/Private/String_io/M/index.html index c90c418ad..0d3e46f43 100644 --- a/cohttp/Cohttp/Private/String_io/M/index.html +++ b/cohttp/Cohttp/Private/String_io/M/index.html @@ -1,5 +1,5 @@ -M (cohttp.Cohttp.Private.String_io.M)

    Module String_io.M

    IO interface that uses buf for input data and queues output data into a Buffer.t

    type 'a t = 'a

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic = buf

    ic represents an input channel

    type oc = Stdlib.Buffer.t

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +M (cohttp.Cohttp.Private.String_io.M)

    Module String_io.M

    IO interface that uses buf for input data and queues output data into a Buffer.t

    type 'a t = 'a

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic = buf

    ic represents an input channel

    type oc = Stdlib.Buffer.t

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    diff --git a/cohttp/Cohttp/Private/String_io/index.html b/cohttp/Cohttp/Private/String_io/index.html index f47eb9b6d..3fa91b44b 100644 --- a/cohttp/Cohttp/Private/String_io/index.html +++ b/cohttp/Cohttp/Private/String_io/index.html @@ -1,3 +1,3 @@ -String_io (cohttp.Cohttp.Private.String_io)

    Module Private.String_io

    IO implementation that uses strings to marshal and unmarshal HTTP

    type buf = {
    1. str : string;
    2. mutable pos : int;
    3. len : int;
    }

    The buffer structured used to keep track of where in the string the library is currently reading from

    val open_in : string -> buf

    open_in s will make the string s available as a buf that can be parsed via Cohttp

    module M : +String_io (cohttp.Cohttp.Private.String_io)

    Module Private.String_io

    IO implementation that uses strings to marshal and unmarshal HTTP

    type buf = {
    1. str : string;
    2. mutable pos : int;
    3. len : int;
    }

    The buffer structured used to keep track of where in the string the library is currently reading from

    val open_in : string -> buf

    open_in s will make the string s available as a buf that can be parsed via Cohttp

    module M : S.IO with type 'a t = 'a and type ic = buf and type oc = Stdlib.Buffer.t

    IO interface that uses buf for input data and queues output data into a Buffer.t

    diff --git a/cohttp/Cohttp/Private/Transfer_io/Make/argument-1-IO/index.html b/cohttp/Cohttp/Private/Transfer_io/Make/argument-1-IO/index.html index 80d47db22..cd2e52366 100644 --- a/cohttp/Cohttp/Private/Transfer_io/Make/argument-1-IO/index.html +++ b/cohttp/Cohttp/Private/Transfer_io/Make/argument-1-IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp.Cohttp.Private.Transfer_io.Make.IO)

    Parameter Make.IO

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp.Cohttp.Private.Transfer_io.Make.IO)

    Parameter Make.IO

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    diff --git a/cohttp/Cohttp/Private/Transfer_io/Make/index.html b/cohttp/Cohttp/Private/Transfer_io/Make/index.html index df7655ea0..e16aa2f4b 100644 --- a/cohttp/Cohttp/Private/Transfer_io/Make/index.html +++ b/cohttp/Cohttp/Private/Transfer_io/Make/index.html @@ -1,2 +1,2 @@ -Make (cohttp.Cohttp.Private.Transfer_io.Make)

    Module Transfer_io.Make

    Parameters

    module IO : S.IO

    Signature

    type reader
    type writer
    val make_reader : Transfer.encoding -> IO.ic -> reader
    val make_writer : ?flush:bool -> Transfer.encoding -> IO.oc -> writer
    val read : reader -> Transfer.chunk IO.t
    val write : writer -> string -> unit IO.t
    +Make (cohttp.Cohttp.Private.Transfer_io.Make)

    Module Transfer_io.Make

    Parameters

    module IO : S.IO

    Signature

    type reader
    type writer
    val make_reader : Transfer.encoding -> IO.ic -> reader
    val make_writer : flush:bool -> Transfer.encoding -> IO.oc -> writer
    val read : reader -> Transfer.chunk IO.t
    val write : writer -> string -> unit IO.t
    diff --git a/cohttp/Cohttp/Private/Transfer_io/index.html b/cohttp/Cohttp/Private/Transfer_io/index.html index 2cdeb5b57..86127b22f 100644 --- a/cohttp/Cohttp/Private/Transfer_io/index.html +++ b/cohttp/Cohttp/Private/Transfer_io/index.html @@ -1,2 +1,2 @@ -Transfer_io (cohttp.Cohttp.Private.Transfer_io)

    Module Private.Transfer_io

    module Make (IO : S.IO) : sig ... end
    +Transfer_io (cohttp.Cohttp.Private.Transfer_io)

    Module Private.Transfer_io

    module Make (IO : S.IO) : sig ... end
    diff --git a/cohttp/Cohttp/Private/index.html b/cohttp/Cohttp/Private/index.html index e74454384..8d7df665a 100644 --- a/cohttp/Cohttp/Private/index.html +++ b/cohttp/Cohttp/Private/index.html @@ -1,2 +1,2 @@ -Private (cohttp.Cohttp.Private)

    Module Cohttp.Private

    module Transfer_io : sig ... end
    module String_io : sig ... end

    IO implementation that uses strings to marshal and unmarshal HTTP

    module Header_io : sig ... end
    +Private (cohttp.Cohttp.Private)

    Module Cohttp.Private

    module Transfer_io : sig ... end
    module String_io : sig ... end

    IO implementation that uses strings to marshal and unmarshal HTTP

    module Header_io : sig ... end
    diff --git a/cohttp/Cohttp/Request/Make/argument-1-IO/index.html b/cohttp/Cohttp/Request/Make/argument-1-IO/index.html index e368f7712..58443c770 100644 --- a/cohttp/Cohttp/Request/Make/argument-1-IO/index.html +++ b/cohttp/Cohttp/Request/Make/argument-1-IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp.Cohttp.Request.Make.IO)

    Parameter Make.IO

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp.Cohttp.Request.Make.IO)

    Parameter Make.IO

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    diff --git a/cohttp/Cohttp/Request/Make/index.html b/cohttp/Cohttp/Request/Make/index.html index 4d5df5578..a95c9901a 100644 --- a/cohttp/Cohttp/Request/Make/index.html +++ b/cohttp/Cohttp/Request/Make/index.html @@ -1,2 +1,2 @@ -Make (cohttp.Cohttp.Request.Make)

    Module Request.Make

    • deprecated This functor is not part of the public API.

    Parameters

    module IO : S.IO

    Signature

    type t = t
    type reader
    type writer
    module IO = IO
    val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of t ] IO.t
    val make_body_writer : ?flush:bool -> t -> IO.oc -> writer
    val make_body_reader : t -> IO.ic -> reader
    val read_body_chunk : reader -> Transfer.chunk IO.t
    val write_header : t -> IO.oc -> unit IO.t
    val write_body : writer -> string -> unit IO.t
    val write : ?flush:bool -> (writer -> unit IO.t) -> t -> IO.oc -> unit IO.t
    +Make (cohttp.Cohttp.Request.Make)

    Module Request.Make

    • deprecated This functor is not part of the public API.

    Parameters

    module IO : S.IO

    Signature

    type t = t
    type reader
    type writer
    module IO = IO
    val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of t ] IO.t
    val make_body_writer : flush:bool -> t -> IO.oc -> writer
    val make_body_reader : t -> IO.ic -> reader
    val read_body_chunk : reader -> Transfer.chunk IO.t
    val write_header : t -> IO.oc -> unit IO.t
    val write_body : writer -> string -> unit IO.t
    val write : flush:bool -> (writer -> unit IO.t) -> t -> IO.oc -> unit IO.t
    diff --git a/cohttp/Cohttp/Request/Private/Make/argument-1-IO/index.html b/cohttp/Cohttp/Request/Private/Make/argument-1-IO/index.html index 575d5c71c..3631b7b8b 100644 --- a/cohttp/Cohttp/Request/Private/Make/argument-1-IO/index.html +++ b/cohttp/Cohttp/Request/Private/Make/argument-1-IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp.Cohttp.Request.Private.Make.IO)

    Parameter Make.IO

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp.Cohttp.Request.Private.Make.IO)

    Parameter Make.IO

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    diff --git a/cohttp/Cohttp/Request/Private/Make/index.html b/cohttp/Cohttp/Request/Private/Make/index.html index 1b0eb2916..c6eefde01 100644 --- a/cohttp/Cohttp/Request/Private/Make/index.html +++ b/cohttp/Cohttp/Request/Private/Make/index.html @@ -1,2 +1,2 @@ -Make (cohttp.Cohttp.Request.Private.Make)

    Module Private.Make

    Parameters

    module IO : S.IO

    Signature

    type t = t
    type reader
    type writer
    module IO = IO
    val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of t ] IO.t
    val make_body_writer : ?flush:bool -> t -> IO.oc -> writer
    val make_body_reader : t -> IO.ic -> reader
    val read_body_chunk : reader -> Transfer.chunk IO.t
    val write_header : t -> IO.oc -> unit IO.t
    val write_body : writer -> string -> unit IO.t
    val write : ?flush:bool -> (writer -> unit IO.t) -> t -> IO.oc -> unit IO.t
    +Make (cohttp.Cohttp.Request.Private.Make)

    Module Private.Make

    Parameters

    module IO : S.IO

    Signature

    type t = t
    type reader
    type writer
    module IO = IO
    val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of t ] IO.t
    val make_body_writer : flush:bool -> t -> IO.oc -> writer
    val make_body_reader : t -> IO.ic -> reader
    val read_body_chunk : reader -> Transfer.chunk IO.t
    val write_header : t -> IO.oc -> unit IO.t
    val write_body : writer -> string -> unit IO.t
    val write : flush:bool -> (writer -> unit IO.t) -> t -> IO.oc -> unit IO.t
    diff --git a/cohttp/Cohttp/Request/Private/index.html b/cohttp/Cohttp/Request/Private/index.html index a0f953099..82486b76e 100644 --- a/cohttp/Cohttp/Request/Private/index.html +++ b/cohttp/Cohttp/Request/Private/index.html @@ -1,2 +1,2 @@ -Private (cohttp.Cohttp.Request.Private)

    Module Request.Private

    module Make (IO : S.IO) : S.Http_io with type t = t and module IO = IO
    +Private (cohttp.Cohttp.Request.Private)

    Module Request.Private

    module Make (IO : S.IO) : S.Http_io with type t = t and module IO = IO
    diff --git a/cohttp/Cohttp/Request/index.html b/cohttp/Cohttp/Request/index.html index 12aadc547..f4b9931b8 100644 --- a/cohttp/Cohttp/Request/index.html +++ b/cohttp/Cohttp/Request/index.html @@ -1,5 +1,5 @@ -Request (cohttp.Cohttp.Request)

    Module Cohttp.Request

    HTTP/1.1 request handling

    This contains the metadata for a HTTP/1.x request header, including the headers, version, meth and uri. The body is handled by the separate S module type, as it is dependent on the IO implementation.

    The interface exposes a fieldslib interface which provides individual accessor functions for each of the records below. It also provides sexp serializers to convert to-and-from an Core.Std.Sexp.t.

    include S.Request with type t = Http.Request.t
    type t = Http.Request.t = {
    1. headers : Header.t;
      (*

      HTTP request headers

      *)
    2. meth : Code.meth;
      (*

      HTTP request method

      *)
    3. scheme : string option;
      (*

      URI scheme (http or https)

      *)
    4. resource : string;
      (*

      Request path and query

      *)
    5. version : Code.version;
      (*

      HTTP version, usually 1.1

      *)
    6. encoding : Transfer.encoding;
      (*
      • deprecated this field will be removed in the future
      *)
    }
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val headers : t -> Header.t
    val meth : t -> Code.meth
    val scheme : t -> string option
    val resource : t -> string
    val version : t -> Code.version
    val encoding : t -> Transfer.encoding
    val compare : t -> t -> int
    val make : +Request (cohttp.Cohttp.Request)

    Module Cohttp.Request

    HTTP/1.1 request handling

    This contains the metadata for a HTTP/1.x request header, including the headers, version, meth and uri. The body is handled by the separate S module type, as it is dependent on the IO implementation.

    The interface exposes a fieldslib interface which provides individual accessor functions for each of the records below. It also provides sexp serializers to convert to-and-from an Core.Std.Sexp.t.

    include S.Request with type t = Http.Request.t
    type t = Http.Request.t = {
    1. headers : Header.t;
      (*

      HTTP request headers

      *)
    2. meth : Code.meth;
      (*

      HTTP request method

      *)
    3. resource : string;
      (*

      Request path and query

      *)
    4. version : Code.version;
      (*

      HTTP version, usually 1.1

      *)
    }
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val headers : t -> Header.t
    val meth : t -> Code.meth
    val resource : t -> string
    val version : t -> Code.version
    val encoding : t -> Transfer.encoding
    val compare : t -> t -> int
    val make : ?meth:Code.meth -> ?version:Code.version -> ?encoding:Transfer.encoding -> diff --git a/cohttp/Cohttp/Response/Make/argument-1-IO/index.html b/cohttp/Cohttp/Response/Make/argument-1-IO/index.html index d2cf32860..a1efbf356 100644 --- a/cohttp/Cohttp/Response/Make/argument-1-IO/index.html +++ b/cohttp/Cohttp/Response/Make/argument-1-IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp.Cohttp.Response.Make.IO)

    Parameter Make.IO

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp.Cohttp.Response.Make.IO)

    Parameter Make.IO

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    diff --git a/cohttp/Cohttp/Response/Make/index.html b/cohttp/Cohttp/Response/Make/index.html index e8bafb32d..396f562d1 100644 --- a/cohttp/Cohttp/Response/Make/index.html +++ b/cohttp/Cohttp/Response/Make/index.html @@ -1,2 +1,2 @@ -Make (cohttp.Cohttp.Response.Make)

    Module Response.Make

    • deprecated This functor is not part of the public API.

    Parameters

    module IO : S.IO

    Signature

    type t = t
    type reader
    type writer
    module IO = IO
    val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of t ] IO.t
    val make_body_writer : ?flush:bool -> t -> IO.oc -> writer
    val make_body_reader : t -> IO.ic -> reader
    val read_body_chunk : reader -> Transfer.chunk IO.t
    val write_header : t -> IO.oc -> unit IO.t
    val write_body : writer -> string -> unit IO.t
    val write : ?flush:bool -> (writer -> unit IO.t) -> t -> IO.oc -> unit IO.t
    +Make (cohttp.Cohttp.Response.Make)

    Module Response.Make

    • deprecated This functor is not part of the public API.

    Parameters

    module IO : S.IO

    Signature

    type t = t
    type reader
    type writer
    module IO = IO
    val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of t ] IO.t
    val make_body_writer : flush:bool -> t -> IO.oc -> writer
    val make_body_reader : t -> IO.ic -> reader
    val read_body_chunk : reader -> Transfer.chunk IO.t
    val write_header : t -> IO.oc -> unit IO.t
    val write_body : writer -> string -> unit IO.t
    val write : flush:bool -> (writer -> unit IO.t) -> t -> IO.oc -> unit IO.t
    diff --git a/cohttp/Cohttp/Response/Private/Make/argument-1-IO/index.html b/cohttp/Cohttp/Response/Private/Make/argument-1-IO/index.html index c7e99281e..f9db357b5 100644 --- a/cohttp/Cohttp/Response/Private/Make/argument-1-IO/index.html +++ b/cohttp/Cohttp/Response/Private/Make/argument-1-IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp.Cohttp.Response.Private.Make.IO)

    Parameter Make.IO

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp.Cohttp.Response.Private.Make.IO)

    Parameter Make.IO

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    diff --git a/cohttp/Cohttp/Response/Private/Make/index.html b/cohttp/Cohttp/Response/Private/Make/index.html index 50c067f0c..f8a571286 100644 --- a/cohttp/Cohttp/Response/Private/Make/index.html +++ b/cohttp/Cohttp/Response/Private/Make/index.html @@ -1,2 +1,2 @@ -Make (cohttp.Cohttp.Response.Private.Make)

    Module Private.Make

    Parameters

    module IO : S.IO

    Signature

    type t = t
    type reader
    type writer
    module IO = IO
    val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of t ] IO.t
    val make_body_writer : ?flush:bool -> t -> IO.oc -> writer
    val make_body_reader : t -> IO.ic -> reader
    val read_body_chunk : reader -> Transfer.chunk IO.t
    val write_header : t -> IO.oc -> unit IO.t
    val write_body : writer -> string -> unit IO.t
    val write : ?flush:bool -> (writer -> unit IO.t) -> t -> IO.oc -> unit IO.t
    +Make (cohttp.Cohttp.Response.Private.Make)

    Module Private.Make

    Parameters

    module IO : S.IO

    Signature

    type t = t
    type reader
    type writer
    module IO = IO
    val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of t ] IO.t
    val make_body_writer : flush:bool -> t -> IO.oc -> writer
    val make_body_reader : t -> IO.ic -> reader
    val read_body_chunk : reader -> Transfer.chunk IO.t
    val write_header : t -> IO.oc -> unit IO.t
    val write_body : writer -> string -> unit IO.t
    val write : flush:bool -> (writer -> unit IO.t) -> t -> IO.oc -> unit IO.t
    diff --git a/cohttp/Cohttp/Response/Private/index.html b/cohttp/Cohttp/Response/Private/index.html index 76a504c37..80a5367c3 100644 --- a/cohttp/Cohttp/Response/Private/index.html +++ b/cohttp/Cohttp/Response/Private/index.html @@ -1,2 +1,2 @@ -Private (cohttp.Cohttp.Response.Private)

    Module Response.Private

    module Make (IO : S.IO) : S.Http_io with type t = t and module IO = IO
    +Private (cohttp.Cohttp.Response.Private)

    Module Response.Private

    module Make (IO : S.IO) : S.Http_io with type t = t and module IO = IO
    diff --git a/cohttp/Cohttp/Response/index.html b/cohttp/Cohttp/Response/index.html index 096f48b36..81c756d61 100644 --- a/cohttp/Cohttp/Response/index.html +++ b/cohttp/Cohttp/Response/index.html @@ -1,8 +1,7 @@ -Response (cohttp.Cohttp.Response)

    Module Cohttp.Response

    HTTP/1.1 response handling

    This contains the metadata for a HTTP/1.1 response header, including the encoding, headers, version, status code and whether to flush the connection after every body chunk (useful for server-side events and other long-lived connection protocols). The body is handled by the separate S module type, as it is dependent on the IO implementation.

    The interface exposes a fieldslib interface which provides individual accessor functions for each of the records below. It also provides sexp serializers to convert to-and-from an Core.Std.Sexp.t.

    include S.Response with type t = Http.Response.t
    type t = Http.Response.t = {
    1. encoding : Transfer.encoding;
      (*
      • deprecated this field will be removed in the future
      *)
    2. headers : Header.t;
      (*

      response HTTP headers

      *)
    3. version : Code.version;
      (*

      (** HTTP version, usually 1.1 *)

      *)
    4. status : Code.status_code;
      (*

      HTTP status code of the response

      *)
    5. flush : bool;
      (*
      • deprecated this field will be removed in the future
      *)
    }
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val encoding : t -> Transfer.encoding
    val headers : t -> Header.t
    val version : t -> Code.version
    val status : t -> Code.status_code
    val flush : t -> bool
    val compare : t -> t -> int
    val make : +Response (cohttp.Cohttp.Response)

    Module Cohttp.Response

    HTTP/1.1 response handling

    This contains the metadata for a HTTP/1.1 response header, including the encoding, headers, version, status code and whether to flush the connection after every body chunk (useful for server-side events and other long-lived connection protocols). The body is handled by the separate S module type, as it is dependent on the IO implementation.

    The interface exposes a fieldslib interface which provides individual accessor functions for each of the records below. It also provides sexp serializers to convert to-and-from an Core.Std.Sexp.t.

    include S.Response with type t = Http.Response.t
    type t = Http.Response.t = {
    1. headers : Header.t;
      (*

      response HTTP headers

      *)
    2. version : Code.version;
      (*

      (** HTTP version, usually 1.1 *)

      *)
    3. status : Code.status_code;
      (*

      HTTP status code of the response

      *)
    }
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val encoding : t -> Transfer.encoding
    val headers : t -> Header.t
    val version : t -> Code.version
    val status : t -> Code.status_code
    val compare : t -> t -> int
    val make : ?version:Code.version -> ?status:Code.status_code -> - ?flush:bool -> ?encoding:Transfer.encoding -> ?headers:Header.t -> unit -> diff --git a/cohttp/Cohttp/S/index.html b/cohttp/Cohttp/S/index.html index 6274b0dc6..fba7c57d1 100644 --- a/cohttp/Cohttp/S/index.html +++ b/cohttp/Cohttp/S/index.html @@ -1,2 +1,2 @@ -S (cohttp.Cohttp.S)

    Module Cohttp.S

    Module type signatures for Cohttp components

    module type IO = sig ... end

    The IO module defines the blocking interface for reading and writing to Cohttp streams

    module type Http_io = sig ... end
    module type Request = sig ... end
    module type Response = sig ... end
    module type Body = sig ... end
    +S (cohttp.Cohttp.S)

    Module Cohttp.S

    Module type signatures for Cohttp components

    module type IO = sig ... end

    The IO module defines the blocking interface for reading and writing to Cohttp streams

    module type Http_io = sig ... end
    module type Request = sig ... end
    module type Response = sig ... end
    module type Body = sig ... end
    diff --git a/cohttp/Cohttp/S/module-type-Body/index.html b/cohttp/Cohttp/S/module-type-Body/index.html index 416b617b5..fe28bd0e2 100644 --- a/cohttp/Cohttp/S/module-type-Body/index.html +++ b/cohttp/Cohttp/S/module-type-Body/index.html @@ -1,2 +1,2 @@ -Body (cohttp.Cohttp.S.Body)

    Module type S.Body

    type t
    val to_string : t -> string
    val to_string_list : t -> string list
    val to_form : t -> (string * string list) list
    val empty : t
    val is_empty : t -> bool
    val of_string : string -> t
    val of_string_list : string list -> t
    val of_form : ?scheme:string -> (string * string list) list -> t
    val map : (string -> string) -> t -> t
    val transfer_encoding : t -> Transfer.encoding
    +Body (cohttp.Cohttp.S.Body)

    Module type S.Body

    type t
    val to_string : t -> string
    val to_string_list : t -> string list
    val to_form : t -> (string * string list) list
    val empty : t
    val is_empty : t -> bool
    val of_string : string -> t
    val of_string_list : string list -> t
    val of_form : ?scheme:string -> (string * string list) list -> t
    val map : (string -> string) -> t -> t
    val transfer_encoding : t -> Transfer.encoding
    diff --git a/cohttp/Cohttp/S/module-type-Http_io/IO/index.html b/cohttp/Cohttp/S/module-type-Http_io/IO/index.html index 2302f5e01..f4f806b32 100644 --- a/cohttp/Cohttp/S/module-type-Http_io/IO/index.html +++ b/cohttp/Cohttp/S/module-type-Http_io/IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp.Cohttp.S.Http_io.IO)

    Module Http_io.IO

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp.Cohttp.S.Http_io.IO)

    Module Http_io.IO

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    diff --git a/cohttp/Cohttp/S/module-type-Http_io/index.html b/cohttp/Cohttp/S/module-type-Http_io/index.html index 7f8c09c06..1c3994180 100644 --- a/cohttp/Cohttp/S/module-type-Http_io/index.html +++ b/cohttp/Cohttp/S/module-type-Http_io/index.html @@ -1,2 +1,2 @@ -Http_io (cohttp.Cohttp.S.Http_io)

    Module type S.Http_io

    type t
    type reader
    type writer
    module IO : IO
    val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of t ] IO.t
    val make_body_writer : ?flush:bool -> t -> IO.oc -> writer
    val make_body_reader : t -> IO.ic -> reader
    val read_body_chunk : reader -> Transfer.chunk IO.t
    val write_header : t -> IO.oc -> unit IO.t
    val write_body : writer -> string -> unit IO.t
    val write : ?flush:bool -> (writer -> unit IO.t) -> t -> IO.oc -> unit IO.t
    +Http_io (cohttp.Cohttp.S.Http_io)

    Module type S.Http_io

    type t
    type reader
    type writer
    module IO : IO
    val read : IO.ic -> [ `Eof | `Invalid of string | `Ok of t ] IO.t
    val make_body_writer : flush:bool -> t -> IO.oc -> writer
    val make_body_reader : t -> IO.ic -> reader
    val read_body_chunk : reader -> Transfer.chunk IO.t
    val write_header : t -> IO.oc -> unit IO.t
    val write_body : writer -> string -> unit IO.t
    val write : flush:bool -> (writer -> unit IO.t) -> t -> IO.oc -> unit IO.t
    diff --git a/cohttp/Cohttp/S/module-type-IO/index.html b/cohttp/Cohttp/S/module-type-IO/index.html index cd175dd17..34ab58b1b 100644 --- a/cohttp/Cohttp/S/module-type-IO/index.html +++ b/cohttp/Cohttp/S/module-type-IO/index.html @@ -1,5 +1,5 @@ -IO (cohttp.Cohttp.S.IO)

    Module type S.IO

    The IO module defines the blocking interface for reading and writing to Cohttp streams

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : +IO (cohttp.Cohttp.S.IO)

    Module type S.IO

    The IO module defines the blocking interface for reading and writing to Cohttp streams

    type +'a t

    'a t represents a blocking monad state

    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

    a >>= b will pass the result of a to the b function. This is a monadic bind.

    val return : 'a -> 'a t

    return a will construct a constant IO value.

    type ic

    ic represents an input channel

    type oc

    oc represents an output channel

    type conn

    conn represents the underlying network flow

    val refill : ic -> [ `Ok | `Eof ] t
    val with_input_buffer : ic -> f:(string -> pos:int -> len:int -> 'a * int) -> 'a
    val read_line : ic -> string option t

    read_line ic will read a single line terminated by CR or CRLF from the input channel ic. It returns None if EOF or other error condition is reached.

    val read : ic -> int -> string t

    read ic len will block until a maximum of len characters are read from the input channel ic. It returns an empty string if EOF or some other error condition occurs on the input channel, and can also return fewer than len characters if input buffering is not sufficient to satisfy the request.

    val write : oc -> string -> unit t

    write oc s will block until the complete s string is written to the output channel oc.

    val flush : oc -> unit t

    flush oc will return when all previously buffered content from calling write have been written to the output channel oc.

    diff --git a/cohttp/Cohttp/S/module-type-Request/index.html b/cohttp/Cohttp/S/module-type-Request/index.html index eef38f903..52773a58f 100644 --- a/cohttp/Cohttp/S/module-type-Request/index.html +++ b/cohttp/Cohttp/S/module-type-Request/index.html @@ -1,5 +1,5 @@ -Request (cohttp.Cohttp.S.Request)

    Module type S.Request

    type t = {
    1. headers : Header.t;
      (*

      HTTP request headers

      *)
    2. meth : Code.meth;
      (*

      HTTP request method

      *)
    3. scheme : string option;
      (*

      URI scheme (http or https)

      *)
    4. resource : string;
      (*

      Request path and query

      *)
    5. version : Code.version;
      (*

      HTTP version, usually 1.1

      *)
    6. encoding : Transfer.encoding;
      (*
      • deprecated this field will be removed in the future
      *)
    }
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val headers : t -> Header.t
    val meth : t -> Code.meth
    val scheme : t -> string option
    val resource : t -> string
    val version : t -> Code.version
    val encoding : t -> Transfer.encoding
    val compare : t -> t -> int
    val make : +Request (cohttp.Cohttp.S.Request)

    Module type S.Request

    type t = {
    1. headers : Header.t;
      (*

      HTTP request headers

      *)
    2. meth : Code.meth;
      (*

      HTTP request method

      *)
    3. resource : string;
      (*

      Request path and query

      *)
    4. version : Code.version;
      (*

      HTTP version, usually 1.1

      *)
    }
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val headers : t -> Header.t
    val meth : t -> Code.meth
    val resource : t -> string
    val version : t -> Code.version
    val encoding : t -> Transfer.encoding
    val compare : t -> t -> int
    val make : ?meth:Code.meth -> ?version:Code.version -> ?encoding:Transfer.encoding -> diff --git a/cohttp/Cohttp/S/module-type-Response/index.html b/cohttp/Cohttp/S/module-type-Response/index.html index 93b69dcc3..e380bb135 100644 --- a/cohttp/Cohttp/S/module-type-Response/index.html +++ b/cohttp/Cohttp/S/module-type-Response/index.html @@ -1,8 +1,7 @@ -Response (cohttp.Cohttp.S.Response)

    Module type S.Response

    type t = {
    1. encoding : Transfer.encoding;
      (*
      • deprecated this field will be removed in the future
      *)
    2. headers : Header.t;
      (*

      response HTTP headers

      *)
    3. version : Code.version;
      (*

      (** HTTP version, usually 1.1 *)

      *)
    4. status : Code.status_code;
      (*

      HTTP status code of the response

      *)
    5. flush : bool;
      (*
      • deprecated this field will be removed in the future
      *)
    }
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val encoding : t -> Transfer.encoding
    val headers : t -> Header.t
    val version : t -> Code.version
    val status : t -> Code.status_code
    val flush : t -> bool
    val compare : t -> t -> int
    val make : +Response (cohttp.Cohttp.S.Response)

    Module type S.Response

    type t = {
    1. headers : Header.t;
      (*

      response HTTP headers

      *)
    2. version : Code.version;
      (*

      (** HTTP version, usually 1.1 *)

      *)
    3. status : Code.status_code;
      (*

      HTTP status code of the response

      *)
    }
    include Sexplib0.Sexpable.S with type t := t
    val t_of_sexp : Sexplib0__.Sexp.t -> t
    val sexp_of_t : t -> Sexplib0__.Sexp.t
    val encoding : t -> Transfer.encoding
    val headers : t -> Header.t
    val version : t -> Code.version
    val status : t -> Code.status_code
    val compare : t -> t -> int
    val make : ?version:Code.version -> ?status:Code.status_code -> - ?flush:bool -> ?encoding:Transfer.encoding -> ?headers:Header.t -> unit -> diff --git a/cohttp/Cohttp/Transfer/index.html b/cohttp/Cohttp/Transfer/index.html index 92a70447c..6aedba74a 100644 --- a/cohttp/Cohttp/Transfer/index.html +++ b/cohttp/Cohttp/Transfer/index.html @@ -1,2 +1,2 @@ -Transfer (cohttp.Cohttp.Transfer)

    Module Cohttp.Transfer

    Read and write the HTTP/1.1 transfer-encoding formats. Currently supported are chunked and content-length.

    type encoding = Http.Transfer.encoding =
    1. | Chunked
      (*

      dynamic chunked encoding

      *)
    2. | Fixed of int64
      (*

      fixed size content

      *)
    3. | Unknown
      (*

      unknown body size, which leads to best-effort

      *)

    The encoding format detected from the transfer-encoding and content-length headers

    val sexp_of_encoding : encoding -> Sexplib0.Sexp.t
    val encoding_of_sexp : Sexplib0.Sexp.t -> encoding
    val pp_encoding : Stdlib.Format.formatter -> encoding -> unit

    Human-readable output.

    type chunk =
    1. | Chunk of string
      (*

      chunk of data and not the end of stream

      *)
    2. | Final_chunk of string
      (*

      the last chunk of data, so no more should be read

      *)
    3. | Done
      (*

      no more body data is present

      *)

    A chunk of body that also signals if there to more to arrive

    val sexp_of_chunk : chunk -> Sexplib0.Sexp.t
    val chunk_of_sexp : Sexplib0.Sexp.t -> chunk
    val string_of_encoding : encoding -> string

    Convert the encoding format to a human-readable string

    val has_body : encoding -> [ `No | `Unknown | `Yes ]

    has_body encoding returns the appropriate variant that indicates whether the HTTP request or response has an associated body. It does not guess: instead Unknown is returned if there is no explicit association.

    +Transfer (cohttp.Cohttp.Transfer)

    Module Cohttp.Transfer

    Read and write the HTTP/1.1 transfer-encoding formats. Currently supported are chunked and content-length.

    type encoding = Http.Transfer.encoding =
    1. | Chunked
      (*

      dynamic chunked encoding

      *)
    2. | Fixed of int64
      (*

      fixed size content

      *)
    3. | Unknown
      (*

      unknown body size, which leads to best-effort

      *)

    The encoding format detected from the transfer-encoding and content-length headers

    val sexp_of_encoding : encoding -> Sexplib0.Sexp.t
    val encoding_of_sexp : Sexplib0.Sexp.t -> encoding
    val pp_encoding : Stdlib.Format.formatter -> encoding -> unit

    Human-readable output.

    type chunk =
    1. | Chunk of string
      (*

      chunk of data and not the end of stream

      *)
    2. | Final_chunk of string
      (*

      the last chunk of data, so no more should be read

      *)
    3. | Done
      (*

      no more body data is present

      *)

    A chunk of body that also signals if there to more to arrive

    val sexp_of_chunk : chunk -> Sexplib0.Sexp.t
    val chunk_of_sexp : Sexplib0.Sexp.t -> chunk
    val string_of_encoding : encoding -> string

    Convert the encoding format to a human-readable string

    val has_body : encoding -> [ `No | `Unknown | `Yes ]

    has_body encoding returns the appropriate variant that indicates whether the HTTP request or response has an associated body. It does not guess: instead Unknown is returned if there is no explicit association.

    diff --git a/cohttp/Cohttp/index.html b/cohttp/Cohttp/index.html index a1298a257..966cf8762 100644 --- a/cohttp/Cohttp/index.html +++ b/cohttp/Cohttp/index.html @@ -1,2 +1,2 @@ -Cohttp (cohttp.Cohttp)

    Module Cohttp

    module Accept : sig ... end

    Accept-Encoding HTTP header parsing and generation

    module Auth : sig ... end

    HTTP Authentication and Authorization header parsing and generation

    module Body : sig ... end

    HTTP request and response body handling

    module Conf : sig ... end

    Compile-time configuration variables

    module Connection : sig ... end
    module Code : sig ... end

    Functions for the HTTP Cookie and Set-Cookie header fields. Using the Set-Cookie header field, an HTTP server can pass name/value pairs and associated metadata (called cookies) to a user agent. When the user agent makes subsequent requests to the server, the user agent uses the metadata and other information to determine whether to return the name/value pairs in the Cookie header.

    module Header : sig ... end

    RFC 5988 ("Web Linking") and RFC 5987 ("Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters")

    module Request : sig ... end

    HTTP/1.1 request handling

    module Response : sig ... end

    HTTP/1.1 response handling

    module S : sig ... end

    Module type signatures for Cohttp components

    module Path : sig ... end
    module Transfer : sig ... end

    Read and write the HTTP/1.1 transfer-encoding formats. Currently supported are chunked and content-length.

    module Generic : sig ... end
    module Private : sig ... end
    +Cohttp (cohttp.Cohttp)

    Module Cohttp

    module Accept : sig ... end

    Accept-Encoding HTTP header parsing and generation

    module Auth : sig ... end

    HTTP Authentication and Authorization header parsing and generation

    module Body : sig ... end

    HTTP request and response body handling

    module Conf : sig ... end

    Compile-time configuration variables

    module Connection : sig ... end
    module Code : sig ... end

    Functions for the HTTP Cookie and Set-Cookie header fields. Using the Set-Cookie header field, an HTTP server can pass name/value pairs and associated metadata (called cookies) to a user agent. When the user agent makes subsequent requests to the server, the user agent uses the metadata and other information to determine whether to return the name/value pairs in the Cookie header.

    module Header : sig ... end

    RFC 5988 ("Web Linking") and RFC 5987 ("Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters")

    module Request : sig ... end

    HTTP/1.1 request handling

    module Response : sig ... end

    HTTP/1.1 response handling

    module S : sig ... end

    Module type signatures for Cohttp components

    module Path : sig ... end
    module Transfer : sig ... end

    Read and write the HTTP/1.1 transfer-encoding formats. Currently supported are chunked and content-length.

    module Generic : sig ... end
    module Private : sig ... end
    diff --git a/cohttp/index.html b/cohttp/index.html index 1422fd89a..5c88c1971 100644 --- a/cohttp/index.html +++ b/cohttp/index.html @@ -1,2 +1,2 @@ -index (cohttp.index)

    cohttp index

    Library cohttp

    The entry point of this library is the module: Cohttp.

    +index (cohttp.index)

    cohttp index

    Library cohttp

    The entry point of this library is the module: Cohttp.

    diff --git a/http/Http/Header/Private/index.html b/http/Http/Header/Private/index.html index e27776347..d6a551d17 100644 --- a/http/Http/Header/Private/index.html +++ b/http/Http/Header/Private/index.html @@ -1,2 +1,2 @@ -Private (http.Http.Header.Private)

    Module Header.Private

    val caseless_equal : string -> string -> bool

    caseless_equal a b must be equivalent to String.equal (String.lowercase_ascii a) (String.lowercase_ascii b).

    +Private (http.Http.Header.Private)

    Module Header.Private

    val caseless_equal : string -> string -> bool

    caseless_equal a b must be equivalent to String.equal (String.lowercase_ascii a) (String.lowercase_ascii b).

    diff --git a/http/Http/Header/index.html b/http/Http/Header/index.html index 8cc422a9e..213d4ec1f 100644 --- a/http/Http/Header/index.html +++ b/http/Http/Header/index.html @@ -1,5 +1,5 @@ -Header (http.Http.Header)

    Module Http.Header

    type t

    Associative list representing HTTP headers. Order of transmission is preserved, which implies that headers with same name are neither removed or concataned by default (see clean_dup to do that).

    The type for HTTP headers.

    val init : unit -> t

    init () constructs a fresh, empty list of HTTP headers.

    val is_empty : t -> bool

    is_empty h tests whether HTTP headers h are empty or not.

    val of_list_rev : (string * string) list -> t
    val of_list : (string * string) list -> t

    of_list l construct a fresh headers from the content of l and in same order. to_list and of_list are defined such as to_list (of_list l) = l is true with case insensitive comparison.

    val to_list : t -> (string * string) list

    to_list h converts HTTP headers h to a list. Order and case is preserved.

    Invariant (with case insensitive comparison): to_list (of_list l) = l

    val init_with : string -> string -> t

    init_with k v construct a fresh HTTP headers with a single header with name k and value v.

    val add : t -> string -> string -> t

    add h k v adds the header name k and its associated value v at the front of header list h.

    val add_list : t -> (string * string) list -> t

    add_list h l adds in order all header pairs contained in l to the header list h.

    Invariant (with case insensitive comparison): to_list (add_list h l) = to_list h @ l

    val add_multi : t -> string -> string list -> t

    add_multi h k vs add multiple header pairs with same name h and values contained in vs in h. The new headers are in the same order that in vs.

    Invariant: get_multi (add_multi h k vs) k = (get_multi h k) @ vs

    val add_opt : t option -> string -> string -> t

    add_opt hopt k v adds the header (k, v) to h if hopt is Some h, or constructs a fresh header list containing this single header if hopt is None.

    val add_unless_exists : t -> string -> string -> t

    add_unless_exists h k v adds (k, v) to h unless the header name k is already present in the header.

    val add_opt_unless_exists : t option -> string -> string -> t

    add_opt_unless_exists h k v adds (k, v) to h if hopt is Some h unless the header name k is already present in the headers. If h is None then a fresh header list is constructed containing the header (k, v).

    val remove : t -> string -> t

    remove h k removes every values associated to the header name k from h.

    val replace : t -> string -> string -> t

    replace h k v replaces the last added value of k from h and removed all other occurences of k if it exists. Otherwise it adds (k, v) to h.

    Invariant: forall h, k, v. get_multi (replace h k v) = [ v ]

    val mem : t -> string -> bool

    mem h k returns true if the header name k appears in h and false otherwise.

    val compare : t -> t -> int

    compare h h' is the structural comparison of two Header values.

    val get : t -> string -> string option

    get h k returns Some v where v is the last added value associated with k in h if it exists and None otherwise

    val get_multi : t -> string -> string list

    get_multi h k returns a list of all values associated with k in h in order they appear in it.

    val get_multi_concat : ?list_value_only:bool -> t -> string -> string option

    get_multi_concat h k returns Some v if there is at least one value associated with k in h and None otherwise. v is the concatenation of all values paired with k in h, separated by a comma and in order they appear in h.

    The optional argument ?list_value_only is false by default. If it is true and there is at least one value associated to k, the returned value is the concatenated values only if k is a header that can have multiple values (like transfer-encoding or accept). Otherwise, the returned value is the last value paired with k in h.

    Invariant: forall h, k not a list-value header. get_multi_concat ~list-value-only:true h k = get h k

    val update : t -> string -> (string option -> string option) -> t

    update h k f returns an header list containing the same headers as h, except for the header name k. Depending on the value of v where v is f (get h k), the header pair (k, v) is added, removed or updated.

    • If v is None, the last occurence of k in h is removed;
    • If v is Some w then the last value paired with k in h is replaced by w if it exists. Otherwise, the pair (k, w) is added;
    • If k was already associated last in h to a value that is physically equal to w, h is returned unchanged.
    val update_all : t -> string -> (string list -> string list) -> t

    update_all h k f returns an header list containing the same headers as h, except for the header k. Depending on the list of values vs where vs is f (get_multi h k), the values associated to the header k are added, removed or updated.

    • If vs is an empty list, every occurences of the header k in h are removed;
    • If vs is a non-empty list, all values previously associated to k are removed and all values in vs are added with add_multi;
    • If k was already associated in h to a list that is equal to vs, h is returned unchanged.
    val iter_ord : (string -> string -> unit) -> t -> unit

    iter_ord f h applies f to all the headers of h following the header order.

    val iter : (string -> string -> unit) -> t -> unit

    iter f h applies f to all the headers of h following an unspecified order. This function is faster than iter_ord.

    val map : (string -> string -> string) -> t -> t
    val fold : (string -> string -> 'a -> 'a) -> t -> 'a -> 'a
    val to_lines : t -> string list

    to_lines h returns header fields as a list of lines. Beware that each line ends with "\r\n" characters.

    val to_frames : t -> string list

    to_frames h returns the same as to_lines but lines do not end with "\r\n" characters.

    val to_string : t -> string
    val clean_dup : t -> t

    clean_dup h cleans duplicates in h following RFC7230§3.2.2; if a duplicated header can not have multiple values, only the last value is kept in place. Otherwise, the values are concatenated and place at the first position the header is encountered in h.

    Already concatenated values (like anhost.com, anotherhost.com in the example below) are not affected by clean_dup. For example,

        transfer-encoding: gzip
    +Header (http.Http.Header)

    Module Http.Header

    type t

    Associative list representing HTTP headers. Order of transmission is preserved, which implies that headers with same name are neither removed or concataned by default (see clean_dup to do that).

    The type for HTTP headers.

    val init : unit -> t

    init () constructs a fresh, empty list of HTTP headers.

    val is_empty : t -> bool

    is_empty h tests whether HTTP headers h are empty or not.

    val of_list_rev : (string * string) list -> t
    val of_list : (string * string) list -> t

    of_list l construct a fresh headers from the content of l and in same order. to_list and of_list are defined such as to_list (of_list l) = l is true with case insensitive comparison.

    val to_list : t -> (string * string) list

    to_list h converts HTTP headers h to a list. Order and case is preserved.

    Invariant (with case insensitive comparison): to_list (of_list l) = l

    val init_with : string -> string -> t

    init_with k v construct a fresh HTTP headers with a single header with name k and value v.

    val add : t -> string -> string -> t

    add h k v adds the header name k and its associated value v at the front of header list h.

    val add_list : t -> (string * string) list -> t

    add_list h l adds in order all header pairs contained in l to the header list h.

    Invariant (with case insensitive comparison): to_list (add_list h l) = to_list h @ l

    val add_multi : t -> string -> string list -> t

    add_multi h k vs add multiple header pairs with same name h and values contained in vs in h. The new headers are in the same order that in vs.

    Invariant: get_multi (add_multi h k vs) k = (get_multi h k) @ vs

    val add_opt : t option -> string -> string -> t

    add_opt hopt k v adds the header (k, v) to h if hopt is Some h, or constructs a fresh header list containing this single header if hopt is None.

    val add_unless_exists : t -> string -> string -> t

    add_unless_exists h k v adds (k, v) to h unless the header name k is already present in the header.

    val add_opt_unless_exists : t option -> string -> string -> t

    add_opt_unless_exists h k v adds (k, v) to h if hopt is Some h unless the header name k is already present in the headers. If h is None then a fresh header list is constructed containing the header (k, v).

    val remove : t -> string -> t

    remove h k removes every values associated to the header name k from h.

    val replace : t -> string -> string -> t

    replace h k v replaces the last added value of k from h and removed all other occurrences of k if it exists. Otherwise it adds (k, v) to h.

    Invariant: forall h, k, v. get_multi (replace h k v) = [ v ]

    val mem : t -> string -> bool

    mem h k returns true if the header name k appears in h and false otherwise.

    val compare : t -> t -> int

    compare h h' is the structural comparison of two Header values.

    val get : t -> string -> string option

    get h k returns Some v where v is the last added value associated with k in h if it exists and None otherwise

    val get_multi : t -> string -> string list

    get_multi h k returns a list of all values associated with k in h in order they appear in it.

    val get_multi_concat : ?list_value_only:bool -> t -> string -> string option

    get_multi_concat h k returns Some v if there is at least one value associated with k in h and None otherwise. v is the concatenation of all values paired with k in h, separated by a comma and in order they appear in h.

    The optional argument ?list_value_only is false by default. If it is true and there is at least one value associated to k, the returned value is the concatenated values only if k is a header that can have multiple values (like transfer-encoding or accept). Otherwise, the returned value is the last value paired with k in h.

    Invariant: forall h, k not a list-value header. get_multi_concat ~list-value-only:true h k = get h k

    val update : t -> string -> (string option -> string option) -> t

    update h k f returns an header list containing the same headers as h, except for the header name k. Depending on the value of v where v is f (get h k), the header pair (k, v) is added, removed or updated.

    • If v is None, the last occurrence of k in h is removed;
    • If v is Some w then the last value paired with k in h is replaced by w if it exists. Otherwise, the pair (k, w) is added;
    • If k was already associated last in h to a value that is physically equal to w, h is returned unchanged.
    val update_all : t -> string -> (string list -> string list) -> t

    update_all h k f returns an header list containing the same headers as h, except for the header k. Depending on the list of values vs where vs is f (get_multi h k), the values associated to the header k are added, removed or updated.

    • If vs is an empty list, every occurrences of the header k in h are removed;
    • If vs is a non-empty list, all values previously associated to k are removed and all values in vs are added with add_multi;
    • If k was already associated in h to a list that is equal to vs, h is returned unchanged.
    val iter_ord : (string -> string -> unit) -> t -> unit

    iter_ord f h applies f to all the headers of h following the header order.

    val iter : (string -> string -> unit) -> t -> unit

    iter f h applies f to all the headers of h following an unspecified order. This function is faster than iter_ord.

    val map : (string -> string -> string) -> t -> t
    val fold : (string -> string -> 'a -> 'a) -> t -> 'a -> 'a
    val to_lines : t -> string list

    to_lines h returns header fields as a list of lines. Beware that each line ends with "\r\n" characters.

    val to_frames : t -> string list

    to_frames h returns the same as to_lines but lines do not end with "\r\n" characters.

    val to_string : t -> string
    val clean_dup : t -> t

    clean_dup h cleans duplicates in h following RFC7230§3.2.2; if a duplicated header can not have multiple values, only the last value is kept in place. Otherwise, the values are concatenated and place at the first position the header is encountered in h.

    Already concatenated values (like anhost.com, anotherhost.com in the example below) are not affected by clean_dup. For example,

        transfer-encoding: gzip
         host: afirsthost.com
         connection: keep-alive
         host: anhost.com, anotherhost.com
    diff --git a/http/Http/Method/index.html b/http/Http/Method/index.html
    index b12324983..b2779d05e 100644
    --- a/http/Http/Method/index.html
    +++ b/http/Http/Method/index.html
    @@ -1,2 +1,2 @@
     
    -Method (http.Http.Method)

    Module Http.Method

    type t = [
    1. | `GET
    2. | `POST
    3. | `HEAD
    4. | `DELETE
    5. | `PATCH
    6. | `PUT
    7. | `OPTIONS
    8. | `TRACE
    9. | `CONNECT
    10. | `Other of string
    ]
    val compare : t -> t -> int
    val body_allowed : t -> bool

    body_allowed meth returns whether meth allows a payload body to be present per RFC7231.

    val of_string : string -> t
    val to_string : t -> string
    val pp : Stdlib.Format.formatter -> t -> unit
    +Method (http.Http.Method)

    Module Http.Method

    type t = [
    1. | `GET
    2. | `POST
    3. | `HEAD
    4. | `DELETE
    5. | `PATCH
    6. | `PUT
    7. | `OPTIONS
    8. | `TRACE
    9. | `CONNECT
    10. | `Other of string
    ]
    val compare : t -> t -> int
    val body_allowed : t -> bool

    body_allowed meth returns whether meth allows a payload body to be present per RFC7231.

    val of_string : string -> t
    val to_string : t -> string
    val pp : Stdlib.Format.formatter -> t -> unit
    diff --git a/http/Http/Private/Parser/index.html b/http/Http/Private/Parser/index.html index 8c1f329aa..db0112e4c 100644 --- a/http/Http/Private/Parser/index.html +++ b/http/Http/Private/Parser/index.html @@ -1,5 +1,5 @@ -Parser (http.Http.Private.Parser)

    Module Private.Parser

    Attempts to parse a buffer into a HTTP request. If successful, it returns the parsed request and an offset value that indicates the starting point of unconsumed content left in the buffer.

    type error =
    1. | Partial
    2. | Msg of string
    val parse_request : +Parser (http.Http.Private.Parser)

    Module Private.Parser

    Attempts to parse a buffer into a HTTP request. If successful, it returns the parsed request and an offset value that indicates the starting point of unconsumed content left in the buffer.

    type error =
    1. | Partial
    2. | Msg of string
    val parse_request : ?pos:int -> ?len:int -> string -> diff --git a/http/Http/Private/index.html b/http/Http/Private/index.html index 98807def3..3b10fe6d4 100644 --- a/http/Http/Private/index.html +++ b/http/Http/Private/index.html @@ -1,2 +1,2 @@ -Private (http.Http.Private)

    Module Http.Private

    module Parser : sig ... end

    Attempts to parse a buffer into a HTTP request. If successful, it returns the parsed request and an offset value that indicates the starting point of unconsumed content left in the buffer.

    +Private (http.Http.Private)

    Module Http.Private

    module Parser : sig ... end

    Attempts to parse a buffer into a HTTP request. If successful, it returns the parsed request and an offset value that indicates the starting point of unconsumed content left in the buffer.

    diff --git a/http/Http/Request/index.html b/http/Http/Request/index.html index df12e3cd2..021e43875 100644 --- a/http/Http/Request/index.html +++ b/http/Http/Request/index.html @@ -1,8 +1,7 @@ -Request (http.Http.Request)

    Module Http.Request

    type t = {
    1. headers : Header.t;
      (*

      HTTP request headers

      *)
    2. meth : Method.t;
      (*

      HTTP request method

      *)
    3. scheme : string option;
      (*

      URI scheme (http or https)

      *)
    4. resource : string;
      (*

      Request path and query

      *)
    5. version : Version.t;
      (*

      HTTP version, usually 1.1

      *)
    6. encoding : Transfer.encoding;
      (*
      • deprecated this field will be removed in the future
      *)
    }
    val has_body : t -> [ `No | `Unknown | `Yes ]
    val headers : t -> Header.t
    val meth : t -> Method.t
    val scheme : t -> string option
    val resource : t -> string
    val version : t -> Version.t
    val encoding : t -> Transfer.encoding
    val compare : t -> t -> int
    val is_keep_alive : t -> bool

    Return true whether the connection should be reused

    val requires_content_length : t -> bool

    requires_content_length t is true if t.meth is one of `POST, `PUT or `PATCH. Otherwise it is false.

    A true value indicates that a request must include a "Content-Length" header.

    See https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2

    val content_length : t -> int option

    content_length t is Some x if the "Content-Length" header in t exists and its value x is a non negative integer, x>=0

    It is None if requires_content_length t = false or the value encoded in "Content-Length" is not a valid integer value, i.e >= 0.

    See https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2

    val supports_chunked_trailers : t -> bool

    supports_chunked_trailers t is true if t contains HTTP header "TE: trailers". Otherwise it is false.

    val add_te_trailers : t -> t

    add_te_trailers t adds HTTP headers, 'TE' and 'Connection' to indicate that a user-agent can handle HTTP chunked trailers headers.

    val make : +Request (http.Http.Request)

    Module Http.Request

    type t = {
    1. headers : Header.t;
      (*

      HTTP request headers

      *)
    2. meth : Method.t;
      (*

      HTTP request method

      *)
    3. resource : string;
      (*

      Request path and query

      *)
    4. version : Version.t;
      (*

      HTTP version, usually 1.1

      *)
    }
    val has_body : t -> [ `No | `Unknown | `Yes ]
    val headers : t -> Header.t
    val meth : t -> Method.t
    val resource : t -> string
    val version : t -> Version.t
    val compare : t -> t -> int
    val is_keep_alive : t -> bool

    Return true whether the connection should be reused

    val requires_content_length : t -> bool

    requires_content_length t is true if t.meth is one of `POST, `PUT or `PATCH. Otherwise it is false.

    A true value indicates that a request must include a "Content-Length" header.

    See https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2

    val content_length : t -> int option

    content_length t is Some x if the "Content-Length" header in t exists and its value x is a non negative integer, x>=0

    It is None if requires_content_length t = false or the value encoded in "Content-Length" is not a valid integer value, i.e >= 0.

    See https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2

    val supports_chunked_trailers : t -> bool

    supports_chunked_trailers t is true if t contains HTTP header "TE: trailers". Otherwise it is false.

    val add_te_trailers : t -> t

    add_te_trailers t adds HTTP headers, 'TE' and 'Connection' to indicate that a user-agent can handle HTTP chunked trailers headers.

    val make : ?meth:Method.t -> ?version:Version.t -> ?headers:Header.t -> - ?scheme:string -> string -> - t

    make resource is a value of t. The default values for the response, if not specified, are as follows: meth is `GET, version is `HTTP_1_1, headers is Header.empty and scheme is None. The request encoding value is determined via the Header.get_transfer_encoding function.

    val pp : Stdlib.Format.formatter -> t -> unit
    + t

    make resource is a value of t. The default values for the response, if not specified, are as follows: meth is `GET, version is `HTTP_1_1, headers is Header.empty. The request encoding value is determined via the Header.get_transfer_encoding function.

    val pp : Stdlib.Format.formatter -> t -> unit
    diff --git a/http/Http/Response/index.html b/http/Http/Response/index.html index 40d2a5602..92c63f7f1 100644 --- a/http/Http/Response/index.html +++ b/http/Http/Response/index.html @@ -1,8 +1,7 @@ -Response (http.Http.Response)

    Module Http.Response

    type t = {
    1. encoding : Transfer.encoding;
      (*
      • deprecated this field will be removed in the future
      *)
    2. headers : Header.t;
      (*

      response HTTP headers

      *)
    3. version : Version.t;
      (*

      (** HTTP version, usually 1.1 *)

      *)
    4. status : Status.t;
      (*

      HTTP status code of the response

      *)
    5. flush : bool;
      (*
      • deprecated this field will be removed in the future. Provide flush in the [respond_*] function instead.
      *)
    }
    val encoding : t -> Transfer.encoding
    val headers : t -> Header.t
    val version : t -> Version.t
    val status : t -> Status.t
    val flush : t -> bool
    val compare : t -> t -> int
    val is_keep_alive : t -> bool

    Return true whether the connection should be reused

    val requires_content_length : ?request_meth:Method.t -> t -> bool

    requires_content_length ~request_meth t is true if a combination of t and request_meth indicates that a response message must include "Content-Length" header. However, please note exceptions to this:

    • Response with status code of 304 may or may not include the header.
    • Response to request with method HEAD may or may not include the header.

    https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2

    val content_length : t -> int option

    content_length t is Some x if the "Content-Length" header in t exists and its value x is a non negative integer, x>=0

    It is None if requires_content_length t = false or the value encoded in "Content-Length" is not a valid integer value, i.e >= 0.

    See https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2

    val make : +Response (http.Http.Response)

    Module Http.Response

    type t = {
    1. headers : Header.t;
      (*

      response HTTP headers

      *)
    2. version : Version.t;
      (*

      (** HTTP version, usually 1.1 *)

      *)
    3. status : Status.t;
      (*

      HTTP status code of the response

      *)
    }
    val headers : t -> Header.t
    val version : t -> Version.t
    val status : t -> Status.t
    val compare : t -> t -> int
    val is_keep_alive : t -> bool

    Return true whether the connection should be reused

    val requires_content_length : ?request_meth:Method.t -> t -> bool

    requires_content_length ~request_meth t is true if a combination of t and request_meth indicates that a response message must include "Content-Length" header. However, please note exceptions to this:

    • Response with status code of 304 may or may not include the header.
    • Response to request with method HEAD may or may not include the header.

    https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2

    val content_length : t -> int option

    content_length t is Some x if the "Content-Length" header in t exists and its value x is a non negative integer, x>=0

    It is None if requires_content_length t = false or the value encoded in "Content-Length" is not a valid integer value, i.e >= 0.

    See https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2

    val make : ?version:Version.t -> ?status:Status.t -> - ?flush:bool -> ?headers:Header.t -> unit -> - t

    make () is a value of t. The default values for the request, if not specified, are: status is `Ok, version is `HTTP_1_1, flush is false and headers is Header.empty. The request encoding value is determined via the Header.get_transfer_encoding function.

    val pp : Stdlib.Format.formatter -> t -> unit
    + t

    make () is a value of t. The default values for the request, if not specified, are: status is `Ok, version is `HTTP_1_1. The request encoding value is determined via the Header.get_transfer_encoding function.

    val pp : Stdlib.Format.formatter -> t -> unit
    diff --git a/http/Http/Status/index.html b/http/Http/Status/index.html index a36cfbefd..c7c16b4c3 100644 --- a/http/Http/Status/index.html +++ b/http/Http/Status/index.html @@ -1,2 +1,2 @@ -Status (http.Http.Status)

    Module Http.Status

    type informational = [
    1. | `Continue
      (*

      Client should continue with request

      *)
    2. | `Switching_protocols
      (*

      Server is switching protocols

      *)
    3. | `Processing
      (*

      Server has received and is processing the request

      *)
    4. | `Checkpoint
      (*

      resume aborted PUT or POST requests

      *)
    ]

    Informational

    type success = [
    1. | `OK
      (*

      standard response for successful HTTP requests

      *)
    2. | `Created
      (*

      request has been fulfilled; new resource created

      *)
    3. | `Accepted
      (*

      request accepted, processing pending

      *)
    4. | `Non_authoritative_information
      (*

      request processed, information may be from another source

      *)
    5. | `No_content
      (*

      request processed, no content returned

      *)
    6. | `Reset_content
      (*

      request processed, no content returned, reset document view

      *)
    7. | `Partial_content
      (*

      partial resource return due to request header

      *)
    8. | `Multi_status
      (*

      XML, can contain multiple separate responses

      *)
    9. | `Already_reported
      (*

      results previously returned

      *)
    10. | `Im_used
      (*

      request fulfilled, reponse is instance-manipulations

      *)
    ]

    Success

    type redirection = [
    1. | `Multiple_choices
      (*

      multiple options for the resource delivered

      *)
    2. | `Moved_permanently
      (*

      this and all future requests directed to the given URI

      *)
    3. | `Found
      (*

      temporary response to request found via alternative URI

      *)
    4. | `See_other
      (*

      permanent response to request found via alternative URI

      *)
    5. | `Not_modified
      (*

      resource has not been modified since last requested

      *)
    6. | `Use_proxy
      (*

      content located elsewhere, retrieve from there

      *)
    7. | `Switch_proxy
      (*

      subsequent requests should use the specified proxy

      *)
    8. | `Temporary_redirect
      (*

      connect again to different URI as provided

      *)
    9. | `Permanent_redirect
      (*

      connect again to a different URI using the same method

      *)
    ]

    Redirection

    type client_error = [
    1. | `Bad_request
      (*

      request cannot be fulfilled due to bad syntax

      *)
    2. | `Unauthorized
      (*

      authentication is possible but has failed

      *)
    3. | `Payment_required
      (*

      payment required, reserved for future use

      *)
    4. | `Forbidden
      (*

      server refuses to respond to request

      *)
    5. | `Not_found
      (*

      requested resource could not be found

      *)
    6. | `Method_not_allowed
      (*

      request method not supported by that resource

      *)
    7. | `Not_acceptable
      (*

      content not acceptable according to the Accept headers

      *)
    8. | `Proxy_authentication_required
      (*

      client must first authenticate itself with the proxy

      *)
    9. | `Request_timeout
      (*

      server timed out waiting for the request

      *)
    10. | `Conflict
      (*

      request could not be processed because of conflict

      *)
    11. | `Gone
      (*

      resource is no longer available and will not be available again

      *)
    12. | `Length_required
      (*

      request did not specify the length of its content

      *)
    13. | `Precondition_failed
      (*

      server does not meet request preconditions

      *)
    14. | `Request_entity_too_large
      (*

      request is larger than the server is willing or able to process

      *)
    15. | `Request_uri_too_long
      (*

      URI provided was too long for the server to process

      *)
    16. | `Unsupported_media_type
      (*

      server does not support media type

      *)
    17. | `Requested_range_not_satisfiable
      (*

      client has asked for unprovidable portion of the file

      *)
    18. | `Expectation_failed
      (*

      server cannot meet requirements of Expect request-header field

      *)
    19. | `I_m_a_teapot
      (*

      I'm a teapot

      *)
    20. | `Enhance_your_calm
      (*

      Twitter rate limiting

      *)
    21. | `Unprocessable_entity
      (*

      request unable to be followed due to semantic errors

      *)
    22. | `Locked
      (*

      resource that is being accessed is locked

      *)
    23. | `Failed_dependency
      (*

      request failed due to failure of a previous request

      *)
    24. | `Upgrade_required
      (*

      client should switch to a different protocol

      *)
    25. | `Precondition_required
      (*

      origin server requires the request to be conditional

      *)
    26. | `Too_many_requests
      (*

      user has sent too many requests in a given amount of time

      *)
    27. | `Request_header_fields_too_large
      (*

      server is unwilling to process the request

      *)
    28. | `No_response
      (*

      server returns no information and closes the connection

      *)
    29. | `Retry_with
      (*

      request should be retried after performing action

      *)
    30. | `Blocked_by_windows_parental_controls
      (*

      Windows Parental Controls blocking access to webpage

      *)
    31. | `Wrong_exchange_server
      (*

      the server cannot reach the client's mailbox

      *)
    32. | `Client_closed_request
      (*

      connection closed by client while HTTP server is processing

      *)
    ]

    Client_error

    type server_error = [
    1. | `Internal_server_error
      (*

      generic error message

      *)
    2. | `Not_implemented
      (*

      server does not recognise method or lacks ability to fulfill

      *)
    3. | `Bad_gateway
      (*

      server received an invalid response from upstream server

      *)
    4. | `Service_unavailable
      (*

      server is currently unavailable

      *)
    5. | `Gateway_timeout
      (*

      gateway did not receive response from upstream server

      *)
    6. | `Http_version_not_supported
      (*

      server does not support the HTTP protocol version

      *)
    7. | `Variant_also_negotiates
      (*

      content negotiation for the request results in a circular reference

      *)
    8. | `Insufficient_storage
      (*

      server is unable to store the representation

      *)
    9. | `Loop_detected
      (*

      server detected an infinite loop while processing the request

      *)
    10. | `Bandwidth_limit_exceeded
      (*

      bandwidth limit exceeded

      *)
    11. | `Not_extended
      (*

      further extensions to the request are required

      *)
    12. | `Network_authentication_required
      (*

      client needs to authenticate to gain network access

      *)
    13. | `Network_read_timeout_error
      (*

      network read timeout behind the proxy

      *)
    14. | `Network_connect_timeout_error
      (*

      network connect timeout behind the proxy

      *)
    ]

    Server_error

    type t = [
    1. | `Code of int
    2. | standard
    ]
    val compare : t -> t -> int
    val to_string : t -> string
    val to_int : t -> int
    val of_int : int -> t
    val reason_phrase_of_code : int -> string
    val pp : Stdlib.Format.formatter -> t -> unit
    +Status (http.Http.Status)

    Module Http.Status

    type informational = [
    1. | `Continue
      (*

      Client should continue with request

      *)
    2. | `Switching_protocols
      (*

      Server is switching protocols

      *)
    3. | `Processing
      (*

      Server has received and is processing the request

      *)
    4. | `Checkpoint
      (*

      resume aborted PUT or POST requests

      *)
    ]

    Informational

    type success = [
    1. | `OK
      (*

      standard response for successful HTTP requests

      *)
    2. | `Created
      (*

      request has been fulfilled; new resource created

      *)
    3. | `Accepted
      (*

      request accepted, processing pending

      *)
    4. | `Non_authoritative_information
      (*

      request processed, information may be from another source

      *)
    5. | `No_content
      (*

      request processed, no content returned

      *)
    6. | `Reset_content
      (*

      request processed, no content returned, reset document view

      *)
    7. | `Partial_content
      (*

      partial resource return due to request header

      *)
    8. | `Multi_status
      (*

      XML, can contain multiple separate responses

      *)
    9. | `Already_reported
      (*

      results previously returned

      *)
    10. | `Im_used
      (*

      request fulfilled, response is instance-manipulations

      *)
    ]

    Success

    type redirection = [
    1. | `Multiple_choices
      (*

      multiple options for the resource delivered

      *)
    2. | `Moved_permanently
      (*

      this and all future requests directed to the given URI

      *)
    3. | `Found
      (*

      temporary response to request found via alternative URI

      *)
    4. | `See_other
      (*

      permanent response to request found via alternative URI

      *)
    5. | `Not_modified
      (*

      resource has not been modified since last requested

      *)
    6. | `Use_proxy
      (*

      content located elsewhere, retrieve from there

      *)
    7. | `Switch_proxy
      (*

      subsequent requests should use the specified proxy

      *)
    8. | `Temporary_redirect
      (*

      connect again to different URI as provided

      *)
    9. | `Permanent_redirect
      (*

      connect again to a different URI using the same method

      *)
    ]

    Redirection

    type client_error = [
    1. | `Bad_request
      (*

      request cannot be fulfilled due to bad syntax

      *)
    2. | `Unauthorized
      (*

      authentication is possible but has failed

      *)
    3. | `Payment_required
      (*

      payment required, reserved for future use

      *)
    4. | `Forbidden
      (*

      server refuses to respond to request

      *)
    5. | `Not_found
      (*

      requested resource could not be found

      *)
    6. | `Method_not_allowed
      (*

      request method not supported by that resource

      *)
    7. | `Not_acceptable
      (*

      content not acceptable according to the Accept headers

      *)
    8. | `Proxy_authentication_required
      (*

      client must first authenticate itself with the proxy

      *)
    9. | `Request_timeout
      (*

      server timed out waiting for the request

      *)
    10. | `Conflict
      (*

      request could not be processed because of conflict

      *)
    11. | `Gone
      (*

      resource is no longer available and will not be available again

      *)
    12. | `Length_required
      (*

      request did not specify the length of its content

      *)
    13. | `Precondition_failed
      (*

      server does not meet request preconditions

      *)
    14. | `Request_entity_too_large
      (*

      request is larger than the server is willing or able to process

      *)
    15. | `Request_uri_too_long
      (*

      URI provided was too long for the server to process

      *)
    16. | `Unsupported_media_type
      (*

      server does not support media type

      *)
    17. | `Requested_range_not_satisfiable
      (*

      client has asked for unprovidable portion of the file

      *)
    18. | `Expectation_failed
      (*

      server cannot meet requirements of Expect request-header field

      *)
    19. | `I_m_a_teapot
      (*

      I'm a teapot

      *)
    20. | `Enhance_your_calm
      (*

      Twitter rate limiting

      *)
    21. | `Unprocessable_entity
      (*

      request unable to be followed due to semantic errors

      *)
    22. | `Locked
      (*

      resource that is being accessed is locked

      *)
    23. | `Failed_dependency
      (*

      request failed due to failure of a previous request

      *)
    24. | `Upgrade_required
      (*

      client should switch to a different protocol

      *)
    25. | `Precondition_required
      (*

      origin server requires the request to be conditional

      *)
    26. | `Too_many_requests
      (*

      user has sent too many requests in a given amount of time

      *)
    27. | `Request_header_fields_too_large
      (*

      server is unwilling to process the request

      *)
    28. | `No_response
      (*

      server returns no information and closes the connection

      *)
    29. | `Retry_with
      (*

      request should be retried after performing action

      *)
    30. | `Blocked_by_windows_parental_controls
      (*

      Windows Parental Controls blocking access to webpage

      *)
    31. | `Wrong_exchange_server
      (*

      the server cannot reach the client's mailbox

      *)
    32. | `Client_closed_request
      (*

      connection closed by client while HTTP server is processing

      *)
    ]

    Client_error

    type server_error = [
    1. | `Internal_server_error
      (*

      generic error message

      *)
    2. | `Not_implemented
      (*

      server does not recognise method or lacks ability to fulfill

      *)
    3. | `Bad_gateway
      (*

      server received an invalid response from upstream server

      *)
    4. | `Service_unavailable
      (*

      server is currently unavailable

      *)
    5. | `Gateway_timeout
      (*

      gateway did not receive response from upstream server

      *)
    6. | `Http_version_not_supported
      (*

      server does not support the HTTP protocol version

      *)
    7. | `Variant_also_negotiates
      (*

      content negotiation for the request results in a circular reference

      *)
    8. | `Insufficient_storage
      (*

      server is unable to store the representation

      *)
    9. | `Loop_detected
      (*

      server detected an infinite loop while processing the request

      *)
    10. | `Bandwidth_limit_exceeded
      (*

      bandwidth limit exceeded

      *)
    11. | `Not_extended
      (*

      further extensions to the request are required

      *)
    12. | `Network_authentication_required
      (*

      client needs to authenticate to gain network access

      *)
    13. | `Network_read_timeout_error
      (*

      network read timeout behind the proxy

      *)
    14. | `Network_connect_timeout_error
      (*

      network connect timeout behind the proxy

      *)
    ]

    Server_error

    type t = [
    1. | `Code of int
    2. | standard
    ]
    val compare : t -> t -> int
    val to_string : t -> string
    val to_int : t -> int
    val of_int : int -> t
    val reason_phrase_of_code : int -> string
    val pp : Stdlib.Format.formatter -> t -> unit
    diff --git a/http/Http/Transfer/Private/index.html b/http/Http/Transfer/Private/index.html index 87fdc25af..44256aafb 100644 --- a/http/Http/Transfer/Private/index.html +++ b/http/Http/Transfer/Private/index.html @@ -1,2 +1,2 @@ -Private (http.Http.Transfer.Private)

    Module Transfer.Private

    val has_body : encoding -> [ `No | `Unknown | `Yes ]
    +Private (http.Http.Transfer.Private)

    Module Transfer.Private

    val has_body : encoding -> [ `No | `Unknown | `Yes ]
    diff --git a/http/Http/Transfer/index.html b/http/Http/Transfer/index.html index e98a0ed49..86bddd736 100644 --- a/http/Http/Transfer/index.html +++ b/http/Http/Transfer/index.html @@ -1,2 +1,2 @@ -Transfer (http.Http.Transfer)

    Module Http.Transfer

    Read and write the HTTP/1.1 transfer-encoding formats. Currently supported are chunked and content-length.

    type encoding =
    1. | Chunked
      (*

      dynamic chunked encoding

      *)
    2. | Fixed of int64
      (*

      fixed size content

      *)
    3. | Unknown
      (*

      unknown body size, which leads to best-effort

      *)

    The encoding format detected from the transfer-encoding and content-length headers

    val compare_encoding : encoding -> encoding -> int
    module Private : sig ... end
    +Transfer (http.Http.Transfer)

    Module Http.Transfer

    Read and write the HTTP/1.1 transfer-encoding formats. Currently supported are chunked and content-length.

    type encoding =
    1. | Chunked
      (*

      dynamic chunked encoding

      *)
    2. | Fixed of int64
      (*

      fixed size content

      *)
    3. | Unknown
      (*

      unknown body size, which leads to best-effort

      *)

    The encoding format detected from the transfer-encoding and content-length headers

    val compare_encoding : encoding -> encoding -> int
    module Private : sig ... end
    diff --git a/http/Http/Version/index.html b/http/Http/Version/index.html index 70c261ea1..b04363e18 100644 --- a/http/Http/Version/index.html +++ b/http/Http/Version/index.html @@ -1,2 +1,2 @@ -Version (http.Http.Version)

    Module Http.Version

    type t = [
    1. | `HTTP_1_0
    2. | `HTTP_1_1
    3. | `Other of string
    ]
    val compare : t -> t -> int
    val of_string : string -> t
    val to_string : t -> string
    val pp : Stdlib.Format.formatter -> t -> unit
    +Version (http.Http.Version)

    Module Http.Version

    type t = [
    1. | `HTTP_1_0
    2. | `HTTP_1_1
    3. | `Other of string
    ]
    val compare : t -> t -> int
    val of_string : string -> t
    val to_string : t -> string
    val pp : Stdlib.Format.formatter -> t -> unit
    diff --git a/http/Http/index.html b/http/Http/index.html index 2647d65e2..9f1a72f3e 100644 --- a/http/Http/index.html +++ b/http/Http/index.html @@ -1,2 +1,2 @@ -Http (http.Http)

    Module Http

    module Version : sig ... end
    module Method : sig ... end
    module Status : sig ... end
    module Transfer : sig ... end

    Read and write the HTTP/1.1 transfer-encoding formats. Currently supported are chunked and content-length.

    module Header : sig ... end
    module Request : sig ... end
    module Response : sig ... end
    module Private : sig ... end
    +Http (http.Http)

    Module Http

    module Version : sig ... end
    module Method : sig ... end
    module Status : sig ... end
    module Transfer : sig ... end

    Read and write the HTTP/1.1 transfer-encoding formats. Currently supported are chunked and content-length.

    module Header : sig ... end
    module Request : sig ... end
    module Response : sig ... end
    module Private : sig ... end
    diff --git a/http/Http_bytebuffer/Bytebuffer/Make/argument-1-IO/index.html b/http/Http_bytebuffer/Bytebuffer/Make/argument-1-IO/index.html index 5bc07f4f9..4aaca1843 100644 --- a/http/Http_bytebuffer/Bytebuffer/Make/argument-1-IO/index.html +++ b/http/Http_bytebuffer/Bytebuffer/Make/argument-1-IO/index.html @@ -1,2 +1,2 @@ -IO (http.Http_bytebuffer.Bytebuffer.Make.IO)

    Parameter Make.IO

    type 'a t
    val (>>|) : 'a t -> ('a -> 'b) -> 'b t
    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
    val return : 'a -> 'a t
    +IO (http.Http_bytebuffer.Bytebuffer.Make.IO)

    Parameter Make.IO

    type 'a t
    val (>>|) : 'a t -> ('a -> 'b) -> 'b t
    val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
    val return : 'a -> 'a t
    diff --git a/http/Http_bytebuffer/Bytebuffer/Make/argument-2-Refill/index.html b/http/Http_bytebuffer/Bytebuffer/Make/argument-2-Refill/index.html index 8b0de5271..2ebe62450 100644 --- a/http/Http_bytebuffer/Bytebuffer/Make/argument-2-Refill/index.html +++ b/http/Http_bytebuffer/Bytebuffer/Make/argument-2-Refill/index.html @@ -1,2 +1,2 @@ -Refill (http.Http_bytebuffer.Bytebuffer.Make.Refill)

    Parameter Make.Refill

    type src
    val refill : src -> bytes -> pos:int -> len:int -> [ `Ok of int | `Eof ] IO.t
    +Refill (http.Http_bytebuffer.Bytebuffer.Make.Refill)

    Parameter Make.Refill

    type src
    val refill : src -> bytes -> pos:int -> len:int -> [ `Ok of int | `Eof ] IO.t
    diff --git a/http/Http_bytebuffer/Bytebuffer/Make/index.html b/http/Http_bytebuffer/Bytebuffer/Make/index.html index 9e5115452..2e08799d4 100644 --- a/http/Http_bytebuffer/Bytebuffer/Make/index.html +++ b/http/Http_bytebuffer/Bytebuffer/Make/index.html @@ -1,2 +1,2 @@ -Make (http.Http_bytebuffer.Bytebuffer.Make)

    Module Bytebuffer.Make

    Parameters

    module IO : sig ... end
    module Refill : sig ... end

    Signature

    val refill : t -> Refill.src -> [ `Ok | `Eof ] IO.t
    val read_line : t -> Refill.src -> string option IO.t
    val read : t -> Refill.src -> int -> string IO.t
    +Make (http.Http_bytebuffer.Bytebuffer.Make)

    Module Bytebuffer.Make

    Parameters

    module IO : sig ... end
    module Refill : sig ... end

    Signature

    val refill : t -> Refill.src -> [ `Ok | `Eof ] IO.t
    val read_line : t -> Refill.src -> string option IO.t
    val read : t -> Refill.src -> int -> string IO.t
    diff --git a/http/Http_bytebuffer/Bytebuffer/index.html b/http/Http_bytebuffer/Bytebuffer/index.html index b1c66b513..856c916ad 100644 --- a/http/Http_bytebuffer/Bytebuffer/index.html +++ b/http/Http_bytebuffer/Bytebuffer/index.html @@ -1,2 +1,2 @@ -Bytebuffer (http.Http_bytebuffer.Bytebuffer)

    Module Http_bytebuffer.Bytebuffer

    type t
    val create : int -> t
    val unsafe_buf : t -> Stdlib.Bytes.t
    val pos : t -> int
    val compact : t -> unit
    val length : t -> int
    val drop : t -> int -> unit
    val to_string : t -> string
    module Make (IO : sig ... end) (Refill : sig ... end) : sig ... end
    +Bytebuffer (http.Http_bytebuffer.Bytebuffer)

    Module Http_bytebuffer.Bytebuffer

    type t
    val create : int -> t
    val unsafe_buf : t -> Stdlib.Bytes.t
    val pos : t -> int
    val compact : t -> unit
    val length : t -> int
    val drop : t -> int -> unit
    val to_string : t -> string
    module Make (IO : sig ... end) (Refill : sig ... end) : sig ... end
    diff --git a/http/Http_bytebuffer/index.html b/http/Http_bytebuffer/index.html index 790c7f0cc..9885b8f98 100644 --- a/http/Http_bytebuffer/index.html +++ b/http/Http_bytebuffer/index.html @@ -1,2 +1,2 @@ -Http_bytebuffer (http.Http_bytebuffer)

    Module Http_bytebuffer

    module Bytebuffer : sig ... end
    +Http_bytebuffer (http.Http_bytebuffer)

    Module Http_bytebuffer

    module Bytebuffer : sig ... end
    diff --git a/http/index.html b/http/index.html index ff44d1557..9758f3700 100644 --- a/http/index.html +++ b/http/index.html @@ -1,2 +1,2 @@ -index (http.index)

    http index

    Library http

    The entry point of this library is the module: Http.

    +index (http.index)

    http index

    Library http

    The entry point of this library is the module: Http.

    diff --git a/index.html b/index.html index 54ed9294a..de30bcd4f 100644 --- a/index.html +++ b/index.html @@ -11,20 +11,20 @@

    OCaml package documentation

      -
    1. cohttp v6.0.0_beta2
    2. -
    3. cohttp-async v6.0.0_beta2
    4. -
    5. cohttp-bench v6.0.0_beta2
    6. -
    7. cohttp-curl v6.0.0_beta2
    8. -
    9. cohttp-curl-async v6.0.0_beta2
    10. -
    11. cohttp-curl-lwt v6.0.0_beta2
    12. -
    13. cohttp-eio v6.0.0_beta2
    14. -
    15. cohttp-lwt v6.0.0_beta2
    16. -
    17. cohttp-lwt-jsoo v6.0.0_beta2
    18. -
    19. cohttp-lwt-unix v6.0.0_beta2
    20. -
    21. cohttp-mirage v6.0.0_beta2
    22. -
    23. cohttp-server-lwt-unix v6.0.0_beta2
    24. -
    25. cohttp-top v6.0.0_beta2
    26. -
    27. http v6.0.0_beta2
    28. +
    29. cohttp v6.0.0
    30. +
    31. cohttp-async v6.0.0
    32. +
    33. cohttp-bench v6.0.0
    34. +
    35. cohttp-curl v6.0.0
    36. +
    37. cohttp-curl-async v6.0.0
    38. +
    39. cohttp-curl-lwt v6.0.0
    40. +
    41. cohttp-eio v6.0.0
    42. +
    43. cohttp-lwt v6.0.0
    44. +
    45. cohttp-lwt-jsoo v6.0.0
    46. +
    47. cohttp-lwt-unix v6.0.0
    48. +
    49. cohttp-mirage v6.0.0
    50. +
    51. cohttp-server-lwt-unix v6.0.0
    52. +
    53. cohttp-top v6.0.0
    54. +
    55. http v6.0.0
    diff --git a/odoc.support/odoc.css b/odoc.support/odoc.css index 83ebcf004..15240b577 100644 --- a/odoc.support/odoc.css +++ b/odoc.support/odoc.css @@ -1,7 +1,7 @@ @charset "UTF-8"; /* Copyright (c) 2016 The odoc contributors. All rights reserved. Distributed under the ISC license, see terms at the end of the file. - odoc 2.4.0 */ + odoc 2.4.3 */ /* Fonts */ /* noticia-text-regular - latin */