Module Fetchify.CreateFetchImplementation
Parameters
Signature
module Status : module type of Fetch_Core.Statusmodule Headers : module type of Fetch_Core.Headersmodule Request : module type of Fetch_Core.Requestmodule Method : module type of Fetch_Core.Methodmodule Body : sig ... endmodule Response : sig ... endval fetch : ?body:string -> ?headers:Headers.t list -> ?meth:Method.t -> string -> (Response.t, string) result promiseMake a fetch-request with a
body(optional),headers(optional),method(defaults to * `GET) to endpointurl.Examples
Fetch.fetch("https://example.com")Fetch.fetch( "https://example.com", ~body="Some, body", ~headers=[("Authorization", "Bearer xyz")], ~meth=`POST)
val get : ?body:string -> ?headers:Headers.t list -> string -> (Response.t, string) result promiseMake a GET-request with a
body(optional),headers(optional) to endpointurl.Examples
Fetch.get("https://example.com")Fetch.get( "https://example.com", ~headers=[("Authorization", "Bearer xyz")], )
val post : ?body:string -> ?headers:Headers.t list -> string -> (Response.t, string) result promiseMake a POST-request with a
body(optional),headers(optional) to endpointurl.Examples
Fetch.post( "https://example.com", ~body="Some, body", ~headers=[("Authorization", "Bearer xyz")], )
val put : ?body:string -> ?headers:Headers.t list -> string -> (Response.t, string) result promiseMake a PUT-request with a
body(optional),headers(optional) to endpointurl.Examples
Fetch.put( "https://example.com/movies/1", ~body="Some, body", ~headers=[("Authorization", "Bearer xyz")], )
val delete : ?body:string -> ?headers:Headers.t list -> string -> (Response.t, string) result promiseMake a DELETE-request with a
body(optional),headers(optional) to endpointurl.Examples
Fetch.delete( "https://example.com/movies/1", ~headers=[("Authorization", "Bearer xyz")], )