Class XmlRpc.client

class client : ?debug:bool -> ?headers:(string * string) list -> ?insecure_ssl:bool -> ?timeout:float -> ?useragent:string -> string -> object .. end

Class for XmlRpc clients. Takes a single mandatory argument, url.

If url is of the form "http://username:password@...", basic authentication will be used.

If url starts with "https", Curl will be used instead of Ocamlnet. The "curl" command-line program must be in your path for this to work. You can use the insecure_ssl setting to allow connections to servers with self-signed certificates; by default this is false and certificates must be valid.

timeout can be used to specify the maximum amount of time elapsed before a connection is cancelled. It defaults to 300.0 seconds.

headers may contain an array of (name, value) pairs of additional headers to send with each request.

The useragent setting provides a convenient way to change the User-Agent header, which defaults to "XmlRpc-Light/<version>".

The debug setting, if true, will enable verbose debugging output to the standard error stream.


val url : string

Url of the remote XmlRpc server.

val mutable debug : bool

If true, Xml messages will be printed to standard error.

val mutable headers : (string * string) list

List of custom HTTP headers to send with each request.

val mutable insecure_ssl : bool

If true, SSL will be allowed even if the certificate is self-signed.

val mutable timeout : float

Maximum time to wait for a request to complete, in seconds.

val mutable useragent : string

User-agent to send in request headers.

method url : string

Gets url.

method debug : bool

Gets debug.

method set_debug : bool -> unit

Sets debug.

method headers : (string * string) list

Gets headers.

method set_headers : (string * string) list -> unit

Sets headers.

method insecure_ssl : bool

Gets insecure_ssl.

method set_insecure_ssl : bool -> unit

Sets insecure_ssl.

method timeout : float

Gets timeout.

method set_timeout : float -> unit

Sets timeout.

method useragent : string

Gets useragent.

method set_useragent : string -> unit

Sets useragent.

method set_base64_encoder : (string -> string) -> unit

Sets an alternate Base-64 binary encoding function.

method set_base64_decoder : (string -> string) -> unit

Sets an alternate Base-64 binary decoding function.

method set_datetime_encoder : (XmlRpcDateTime.t -> string) -> unit

Sets an alternate ISO-8601 date/time encoding function.

method set_datetime_decoder : (string -> XmlRpcDateTime.t) -> unit

Sets an alternate ISO-8601 date/time decoding function.

method call : string -> value list -> value

call name params invokes an XmlRpc method and returns the result, or raises XmlRpc.Error on error.