package equinoxe-hlc

  1. Overview
  2. Docs

Module Equinoxe_hlc.BackendSource

This module gathers all the methods you need to be able to execute HTTP requests to contact an API server. It must send application/json request.

Sourcetype 'a io = ('a, [ `Msg of string ]) Lwt_result.t

The I/O monad used to execute HTTP request.

Sourceval return : 'a -> 'a io
Sourceval map : ('a -> 'b) -> 'a io -> 'b io
Sourceval bind : ('a -> 'b io) -> 'a io -> 'b io
Sourceval fail : [ `Msg of string ] -> 'a io
Sourceval get : headers:(string * string) list -> url:string -> string io

get ~headers ~url executes a request to the server as a GET call and, returns the result as a string.

Sourceval post : headers:(string * string) list -> url:string -> string -> string io

post ~headers ~url body executes a request to the server as a POST call using body to describe the request. It returns the result as a string.

Sourceval put : headers:(string * string) list -> url:string -> string -> string io

put ~headers ~url body executes a request to the server as a PUT call using body to describe the request. It returns the result as a string.

Sourceval delete : headers:(string * string) list -> url:string -> string io

delete ~headers ~url executes a request to the server as a DELETE call and returns the result as a string.

OCaml

Innovation. Community. Security.