Module Ezcurl_core.Make

Parameters

Signature

type 'a io = 'a IO.t
val http : ?⁠tries:int -> ?⁠client:t -> ?⁠config:Config.t -> ?⁠range:string -> ?⁠content:string -> ?⁠headers:(string * string) list -> url:string -> meth:meth -> unit -> (response, Curl.curlCode * string) Stdlib.result io

General purpose HTTP call via cURL.

parameter url

the URL to query

parameter meth

which method to use (see meth)

parameter tries

how many times to retry in case of CURLE_AGAIN code

parameter client

a client to reuse (instead of allocating a new one)

parameter range

an optional byte range to fetch (either to get large pages by chunks, or to resume an interrupted download).

parameter config

configuration to set

parameter content

the content to send as the query's body

parameter headers

headers of the query

val get : ?⁠tries:int -> ?⁠client:t -> ?⁠config:Config.t -> ?⁠range:string -> ?⁠headers:(string * string) list -> url:string -> unit -> (response, Curl.curlCode * string) Stdlib.result io

Shortcut for http ~meth:GET See http for more info.

val put : ?⁠tries:int -> ?⁠client:t -> ?⁠config:Config.t -> ?⁠headers:(string * string) list -> url:string -> content:string -> unit -> (response, Curl.curlCode * string) Stdlib.result io

Shortcut for http ~meth:PUT See http for more info.

val post : ?⁠tries:int -> ?⁠client:t -> ?⁠config:Config.t -> ?⁠headers:(string * string) list -> params:Curl.curlHTTPPost list -> url:string -> unit -> (response, Curl.curlCode * string) Stdlib.result io

Shortcut for http ~meth:(POST params) See http for more info.