package rock

  1. Overview
  2. Docs

Module Rock.RequestSource

Module to create HTTP requests.

Sourcetype t = {
  1. version : Httpaf.Version.t;
  2. target : string;
  3. headers : Httpaf.Headers.t;
  4. meth : Httpaf.Method.t;
  5. body : Body.t;
  6. env : Context.t;
}

Constructors

make

Sourceval make : ?version:Httpaf.Version.t -> ?body:Body.t -> ?env:Context.t -> ?headers:Httpaf.Headers.t -> string -> Httpaf.Method.t -> t

make ?version ?body ?env ?headers target method creates a new request from the given values.

By default, the HTTP version will be set to 1.1 and the request will not contain any header or body.

get

Sourceval get : ?version:Httpaf.Version.t -> ?body:Body.t -> ?env:Context.t -> ?headers:Httpaf.Headers.t -> string -> t

get ?version ?body ?env ?headers target creates a new GET request from the given values.

By default, the HTTP version will be set to 1.1 and the request will not contain any header or body.

post

Sourceval post : ?version:Httpaf.Version.t -> ?body:Body.t -> ?env:Context.t -> ?headers:Httpaf.Headers.t -> string -> t

post ?version ?body ?env ?headers target creates a new POST request from the given values.

By default, the HTTP version will be set to 1.1 and the request will not contain any header or body.

put

Sourceval put : ?version:Httpaf.Version.t -> ?body:Body.t -> ?env:Context.t -> ?headers:Httpaf.Headers.t -> string -> t

put ?version ?body ?env ?headers target creates a new PUT request from the given values.

By default, the HTTP version will be set to 1.1 and the request will not contain any header or body.

delete

Sourceval delete : ?version:Httpaf.Version.t -> ?body:Body.t -> ?env:Context.t -> ?headers:Httpaf.Headers.t -> string -> t

delete ?version ?body ?env ?headers target creates a new DELETE request from the given values.

By default, the HTTP version will be set to 1.1 and the request will not contain any header or body.

OCaml

Innovation. Community. Security.