Io.Net
val tls_config : Tls.Config.client
val empty_headers : Http.Header.t
type _ response =
| Raw : ((Http.Response.t * Cohttp_eio.Body.t) -> 'a) -> 'a response
| Default : string response
val post :
'a response ->
net:_ Eio.Net.t ->
host:string ->
headers:Http.Header.t ->
path:string ->
string ->
'a
post res_typ ~net ~host ~headers ~path body
sends an HTTP POST request with the given parameters and returns the response.
val get :
'a response ->
net:_ Eio.Net.t ->
host:string ->
?headers:Http.Header.t ->
string ->
'a
get res_typ ~net ~host ?headers path
sends an HTTP GET request with the given parameters and returns the response.
val download_file :
_ Eio.Net.t ->
string ->
dir:Eio.Fs.dir_ty Eio.Path.t ->
filename:string ->
unit
download_file net url ~dir ~filename
downloads the file from the given url
and saves it to the specified dir
and filename
.