package quests

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Quests provides functions get, post, put and so on for making requests. You can also call request with a specified method.

The same API is used in Session to make requests with persistent connections.

val request : Cohttp.Code.meth -> ?params:(string * string) list -> ?data:Request.payload -> ?headers:(string * string) list -> ?auth:Request.authentication -> ?follow_redirects:bool -> string -> Response.t Lwt.t

request meth ?params ?data ?headers ?auth ~follow_redirects url makes a request to url with method meth, a query string specified by params, a body specified by data, additional headers specified by headers, authentication specified by auth, and whether redirects should be followed automatically by follow_redirects (which defaults to true).

val get : ?params:(string * string) list -> ?data:Request.payload -> ?headers:(string * string) list -> ?auth:Request.authentication -> ?follow_redirects:bool -> string -> Response.t Lwt.t
val post : ?params:(string * string) list -> ?data:Request.payload -> ?headers:(string * string) list -> ?auth:Request.authentication -> ?follow_redirects:bool -> string -> Response.t Lwt.t
val put : ?params:(string * string) list -> ?data:Request.payload -> ?headers:(string * string) list -> ?auth:Request.authentication -> ?follow_redirects:bool -> string -> Response.t Lwt.t
val delete : ?params:(string * string) list -> ?data:Request.payload -> ?headers:(string * string) list -> ?auth:Request.authentication -> ?follow_redirects:bool -> string -> Response.t Lwt.t
module Request : sig ... end

Various types to do with HTTP requests.

module Response : sig ... end

Functions for dealing with responses from requests.

module Session : sig ... end

Sessions can be used to make multiple requests to a host that share the underlying TCP connection. Requests with sessions are made in the same way as ones without, with Quests.get replaced by Session.get a_session.