package piaf

  1. Overview
  2. Docs
type t
val create : ?config:Config.t -> Uri.t -> (t, Error.t) Lwt_result.t

create ?config uri opens a connection to uri (initially) that can be used to issue multiple requests to the remote endpoint.

A client instance represents a connection to a single remote endpoint, and the remaining functions in this module will issue requests to that endpoint only.

val head : t -> ?headers:(string * string) list -> string -> (Response.t, Error.t) Lwt_result.t
val get : t -> ?headers:(string * string) list -> string -> (Response.t, Error.t) Lwt_result.t
val post : t -> ?headers:(string * string) list -> ?body:Body.t -> string -> (Response.t, Error.t) Lwt_result.t
val put : t -> ?headers:(string * string) list -> ?body:Body.t -> string -> (Response.t, Error.t) Lwt_result.t
val patch : t -> ?headers:(string * string) list -> ?body:Body.t -> string -> (Response.t, Error.t) Lwt_result.t
val delete : t -> ?headers:(string * string) list -> ?body:Body.t -> string -> (Response.t, Error.t) Lwt_result.t
val request : t -> ?headers:(string * string) list -> ?body:Body.t -> meth:Method.t -> string -> (Response.t, Error.t) Lwt_result.t
val shutdown : t -> unit Lwt.t

shutdown t tears down the connection t and frees up all the resources associated with it.

module Oneshot : sig ... end
OCaml

Innovation. Community. Security.