Module Madge.Request

Request

An HTTP request, according to Madge.

type meth =
  1. | GET
  2. | POST
  3. | HEAD
  4. | DELETE
  5. | PATCH
  6. | PUT
  7. | OPTIONS
  8. | TRACE
  9. | CONNECT

HTTP methods.

val meth_to_string : meth -> string
val meth_to_cohttp_code_meth : meth -> Cohttp.Code.meth
val cohttp_code_meth_to_meth : Cohttp.Code.meth -> meth
val is_safe : meth -> bool

Whether the method is safe, according to the HTTP specification. Safe methods are not supposed to have any side-effect on the server and can therefore be cached. See https://developer.mozilla.org/en-US/docs/Glossary/Safe/HTTP

type t

Abstract type of a request.

val to_yojson : t -> Yojson.Safe.t
val of_yojson : Yojson.Safe.t -> t Ppx_deriving_yojson_runtime.error_or
val make : meth:meth -> uri:Uri.t -> body:string -> t

Make a request from a method, a URI and a body.

val meth : t -> meth
val uri : t -> Uri.t
val body : t -> string