package picos_io_cohttp

  1. Overview
  2. Docs

Module Picos_io_cohttp.ClientSource

Convenience functions for constructing requests and processing responses.

Please consult the CoHTTP documentation.

include Cohttp.Generic.Client.S with type 'a io = 'a with type 'a with_context = 'a with type body = Cohttp.Body.t
Sourcetype 'a io = 'a
Sourcetype 'a with_context = 'a
Sourceval map_context : 'a with_context -> ('a -> 'b) -> 'b with_context
Sourceval call : (?headers:Http.Header.t -> ?body:body -> ?chunked:bool -> Http.Method.t -> Uri.t -> (Http.Response.t * body) io) with_context

call ?headers ?body ?chunked meth uri

  • returns

    (response, response_body) Consume response_body in a timely fashion. Please see call about how and why.

  • parameter chunked

    use chunked encoding if true. The default is false for compatibility reasons.

Sourceval delete : (?body:body -> ?chunked:bool -> ?headers:Http.Header.t -> Uri.t -> (Http.Response.t * body) io) with_context
Sourceval post : (?body:body -> ?chunked:bool -> ?headers:Http.Header.t -> Uri.t -> (Http.Response.t * body) io) with_context
Sourceval put : (?body:body -> ?chunked:bool -> ?headers:Http.Header.t -> Uri.t -> (Http.Response.t * body) io) with_context
Sourceval patch : (?body:body -> ?chunked:bool -> ?headers:Http.Header.t -> Uri.t -> (Http.Response.t * body) io) with_context