package equinoxe
Library
Module
Module type
Parameter
Class
Class type
The S
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.
t
contains the information about the token you are using to identify the client and the address of the server (URL).
val token : t -> string
token t
returns the token associated with the data structure.
val address : t -> string
address t
returns the address of the server.
val create :
address:string ->
?token:[ `Default | `Str of string | `Path of string ] ->
unit ->
t
create ~address ~token ()
builds the configuration you are going to use to execute the request. If token
is not provided, it will extract the token from the environment variable EQUINOXE_TOKEN
.
get t ~path ()
executes a request to the server as a GET
call and, returns the result as Json.t
.
delete t ~path ()
executes a request to the server as a DELETE
call and, returns the result as Json.t
.