Module Quests.Response
Functions for dealing with responses from requests.
type t
=
{
content : string;
status_code : int;
headers : Cohttp.Header.t;
request : Request.t;
}
The response from a request. The
request
field contains details about the actual request sent (for instance, it includes headers added by Quests, and the URL will have a query string with any supplied parameters.
val pp : Stdlib.Format.formatter -> t -> unit
val show : t -> string
val content : t -> string
val status_code : t -> int
val headers : t -> Cohttp.Header.t
val ok : t -> bool
Returns whether a request has been successful.
val json : t -> Yojson.Safe.t
Parses the body of a response into JSON.