adjust documentation

This commit is contained in:
Hannes Mehnert 2022-10-27 20:59:49 +02:00
parent df099590c9
commit a03e4c1e61
2 changed files with 7 additions and 1 deletions

View file

@ -52,7 +52,8 @@ open Lwt.Infix
module Make (HTTP_client : Http_mirage_client.S) = struct
let start http_client =
Http_mirage_client.one_request http_client "https://mirage.io/"
let body_f _response acc data = Lwt.return (acc ^ data) in
Http_mirage_client.one_request http_client "https://mirage.io/" body_f ""
>>= function
| Ok (resp, body) -> ...
| Error _ -> ...

View file

@ -36,3 +36,8 @@ val request :
-> (response -> 'a -> string -> 'a Lwt.t)
-> 'a
-> (response * 'a, [> Mimic.error ]) result Lwt.t
(** [request ~config ~tls_config t ~authenticator ~meth ~headers ~body
~max_redirect ~follow_redirect url body_f body_init] does a HTTP request
to [url] using [meth] and the HTTP protocol in [config]. The response is
the value of this function. The body is provided in chunks (see [body_f]).
Reasonably defaults are used if not provided. *)