package resto-cohttp-client

  1. Overview
  2. Docs

Parameters

Signature

module Service : module type of struct include Resto.MakeService(Encoding) end
type content_type = string * string
type raw_content = Cohttp_lwt.Body.t * content_type option
type ('o, 'e) generic_rest_result = [
  1. | `Ok of 'o option
  2. | `Conflict of 'e
  3. | `Error of 'e
  4. | `Forbidden of 'e
  5. | `Not_found of 'e
  6. | `Gone of 'e
  7. | `Unauthorized of 'e
  8. | `Bad_request of string
  9. | `Method_not_allowed of string list
  10. | `Unsupported_media_type
  11. | `Not_acceptable of string
  12. | `Unexpected_status_code of Cohttp.Code.status_code * content
  13. | `Connection_failed of string
  14. | `OCaml_exception of string
  15. | `Unauthorized_host of string option
]
module type LOGGER = sig ... end
type logger = (module LOGGER)
val null_logger : logger
val timings_logger : gettimeofday:(unit -> float) -> Format.formatter -> logger
val full_logger : Format.formatter -> logger
val generic_call : [< Resto.meth ] -> ?headers:(string * string) list -> ?accept:Resto_cohttp.Media_type.Make(Encoding).t list -> ?body:Cohttp_lwt.Body.t -> ?media:Resto_cohttp.Media_type.Make(Encoding).t -> Uri.t -> (content, content) generic_rest_result Lwt.t
type ('o, 'e) service_result = [
  1. | ('o, 'e option) generic_rest_result
  2. | `Unexpected_content_type of raw_content
  3. | `Unexpected_content of (string * Resto_cohttp.Media_type.Make(Encoding).t) * string
  4. | `Unexpected_error_content_type of raw_content
  5. | `Unexpected_error_content of (string * Resto_cohttp.Media_type.Make(Encoding).t) * string
]
val call_service : Resto_cohttp.Media_type.Make(Encoding).t list -> ?logger:logger -> ?headers:(string * string) list -> ?base:Uri.t -> ([< Resto.meth ], unit, 'p, 'q, 'i, 'o, 'e) Service.t -> 'p -> 'q -> 'i -> (Resto.meth * Uri.t * ('o, 'e) service_result) Lwt.t
val call_streamed_service : Resto_cohttp.Media_type.Make(Encoding).t list -> ?logger:logger -> ?headers:(string * string) list -> ?base:Uri.t -> ([< Resto.meth ], unit, 'p, 'q, 'i, 'o, 'e) Service.t -> on_chunk:('o -> unit) -> on_close:(unit -> unit) -> 'p -> 'q -> 'i -> (Resto.meth * Uri.t * (unit -> unit, 'e) service_result) Lwt.t
OCaml

Innovation. Community. Security.