module Convenience:sig..end
open Http_client.Convenience for simple applications.
The environment variables http_proxy and no_proxy determine
the proxy settings. http_proxy must be an http-URL that contains
the proxy's name, its port, and optionally user and password.
E.g. "http://eric:ericspassword@proxy:8080/".
The variable no_proxy is a comma-separated list of hosts and
domains for which no proxy must be used.
E.g. "localhost, sun, moon, .intra.net"
There is a default behaviour for authentication. Both "basic" and
"digest" methods are enabled. Two global variables, http_user and
http_password set the user and password if the URL does not specify
them. In the case that user and password are included in the URL,
these values are always
used.
There is a default error behaviour. If a request fails, it is
automatically repeated. The variable http_trials specifies the number
of times a request is submitted at most.
Requests are not repeated if there is a HTTP return code that indicates
a normal operating condition.
POST and DELETE requests are never repeated.
Error codes are reported as Http_client.Http_error. Note that
this is different than what the pipeline core does.
"https" support can be additionally configured via Https_client.
Thread safety
The Convenience module is fully thread-safe with the exception of the
exported variables (http_trials, http_user, and http_password). Note
that all threads share the same pipeline, and access to the pipeline
is serialized.
The latter simply means that it always works, but that threads may
block each other (i.e. the program slows down if more than one thread
wants to open http connections at the same time).
val http_trials : int Pervasives.refval http_user : string Pervasives.refval http_password : string Pervasives.refval configure_pipeline : (Http_client.pipeline -> unit) -> unitval http_get_message : string -> Http_client.http_callval http_head_message : string -> Http_client.http_callval http_post_message : string -> (string * string) list -> Http_client.http_callval http_put_message : string -> string -> Http_client.http_callval http_delete_message : string -> Http_client.http_callval http_get : string -> stringval http_post : string -> (string * string) list -> stringval http_put : string -> string -> stringval http_delete : string -> stringval http_verbose : ?verbose_status:bool ->
?verbose_request_header:bool ->
?verbose_response_header:bool ->
?verbose_request_contents:bool ->
?verbose_response_contents:bool ->
?verbose_connection:bool -> ?verbose_events:bool -> unit -> unit