package cohttp-eio
Module Cohttp_eio.ClientSource
include Cohttp.Generic.Client.S
with type 'a with_context = t -> sw:Eio.Std.Switch.t -> 'a
and type 'a io = 'a
and type body = Body.t
Source
val call :
(?headers:Http.Header.t ->
?body:body ->
?chunked:bool ->
Http.Method.t ->
Uri.t ->
(Http.Response.t * body) io)
with_contextcall ?headers ?body ?chunked meth uri
Source
val delete :
(?body:body ->
?chunked:bool ->
?headers:Http.Header.t ->
Uri.t ->
(Http.Response.t * body) io)
with_contextSource
val post :
(?body:body ->
?chunked:bool ->
?headers:Http.Header.t ->
Uri.t ->
(Http.Response.t * body) io)
with_contextSource
val put :
(?body:body ->
?chunked:bool ->
?headers:Http.Header.t ->
Uri.t ->
(Http.Response.t * body) io)
with_contextSource
val patch :
(?body:body ->
?chunked:bool ->
?headers:Http.Header.t ->
Uri.t ->
(Http.Response.t * body) io)
with_contextSource
val make :
https:
(Uri.t ->
[ Eio.Flow.two_way_ty | Eio.Resource.close_ty ] Eio.Std.r ->
[> Eio.Resource.close_ty ] Eio.Flow.two_way)
option ->
_ Eio.Net.t ->
tmake ~https net is a convenience wrapper around make_generic that uses net to make connections.
- URIs of the form "http://host:port/..." connect to the given TCP host and port.
- URIs of the form "https://host:port/..." connect to the given TCP host and port, and are then wrapped by
https(or rejected if that isNone). - URIs of the form "httpunix://unix-path/http-path" connect to the given Unix path.
Source
val make_generic :
(sw:Eio.Std.Switch.t -> Uri.t -> [> Eio.Resource.close_ty ] Eio.Flow.two_way) ->
tmake_generic connect is an HTTP client that uses connect to get the connection to use for a given URI.
Source
val set_proxies :
?no_proxy_patterns:string ->
?default_proxy:Uri.t ->
?scheme_proxies:(string * Uri.t) list ->
?proxy_headers:Http.Header.t ->
unit ->
unitset_proxies ~default_proxy () configures the proxies used by clients created via make.
See Cohttp.Proxy.Forward.make_servers for the meaning of the parameters.