From a03e4c1e61ef503e6ae93685d35c77136749dd2d Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Thu, 27 Oct 2022 20:59:49 +0200 Subject: [PATCH] adjust documentation --- README.md | 3 ++- src/http_mirage_client.mli | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a447342..f52a206 100644 --- a/README.md +++ b/README.md @@ -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 _ -> ... diff --git a/src/http_mirage_client.mli b/src/http_mirage_client.mli index 6ba8ae6..f0ef229 100644 --- a/src/http_mirage_client.mli +++ b/src/http_mirage_client.mli @@ -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. *)