110 namespace RestClient {
129 "out": \make_xmlrpc_value(),
134 const DeserializeYaml = (
138 const DeserializeXmlRpc = (
140 "in": \parse_xmlrpc_value(),
404 hash get(
string path, any body, *reference info, *
hash hdr);
432 hash put(
string path, any body, *reference info, *
hash hdr);
460 hash post(
string path, any body, *reference info, *
hash hdr);
488 hash del(
string path, any body, *reference info, *
hash hdr);
492 private nothing
prepareMsg(reference body, reference hdr,
string ct =
"Content-Type");
527 hash doRequest(
string m,
string path, any body, *reference info, softbool decode_errors =
True, *
hash hdr);
hash doRequest(string m, string path, any body, *reference info, softbool decode_errors=True, *hash hdr)
sends an HTTP request to the REST server and returns the response
this class provides the REST client API
Definition: RestClient.qm.dox.h:113
const Version
RestClient Version.
Definition: RestClient.qm.dox.h:166
string sprintf(string fmt,...)
const AcceptList
Accept header list.
Definition: RestClient.qm.dox.h:156
const DataSerializationSupport
Data serialization support mapping codes to MIME types and de/serialization functions.
Definition: RestClient.qm.dox.h:118
hash del(string path, any body, *reference info, *hash hdr)
sends an HTTP DELETE request to the REST server and returns the response
addDefaultHeaders(hash h)
adds default headers to each request; these headers will be sent in all requests but can be overridde...
setSendEncoding(string enc="auto")
change the data content encoding (compression) option for the object; see EncodingSupport for valid o...
hash sendAndDecodeResponse(*data body, string m, string path, hash hdr, *reference info, *softbool decode_errors)
sends the outgoing HTTP message and recodes the response to data
const DefaultHeaders
default HTTP headers (Content-Type is added before sending)
Definition: RestClient.qm.dox.h:172
hash getDefaultHeaders()
returns the hash of default headers to sent in all requests
hash put(string path, any body, *reference info, *hash hdr)
sends an HTTP PUT request to the REST server and returns the response
const DataDeserializationSupport
Data deserialization support MIME types to codes and de/serialization functions.
Definition: RestClient.qm.dox.h:144
private nothing prepareMsg(reference body, reference hdr, string ct="Content-Type")
sets up the Content-Type header and encodes any body for sending
const DataSerializationOptions
Data serialization options; this is a hash to simulate a set of strings.
Definition: RestClient.qm.dox.h:184
const Accept
Accept header value.
Definition: RestClient.qm.dox.h:163
const VersionString
RestClient Version String.
Definition: RestClient.qm.dox.h:169
string getSerialization()
returns the current data serialization format currently in effect for the object (see DataSerializati...
binary bzip2(binary bin, softint level=BZ2_DEFAULT_COMPRESSION)
decodeResponse(reference h, *reference info)
decodes the response
*string getSendEncoding()
returns the current data content encoding (compression) object or NOTHING if no encoding option is se...
binary gzip(string str, int level=Z_DEFAULT_COMPRESSION)
const CompressionThreshold
default threadhold for data compressions; transfers smaller than this size will not be compressed ...
Definition: RestClient.qm.dox.h:217
private decodeError(hash h, *reference info)
decode any REST errors returned if possible
hash post(string path, any body, *reference info, *hash hdr)
sends an HTTP POST request to the REST server and returns the response
private nothing preparePath(reference path)
sets up the path for the HTTP request URI
setSerialization(string data="auto")
change the serialization option for the object; see DataSerializationOptions for valid options ...
setContentEncoding(string enc="auto")
sets the request and desired response encoding for the object; see EncodingSupport for valid options ...
const EncodingSupport
Send content encoding options.
Definition: RestClient.qm.dox.h:198
binary compress(string str, int level=Z_DEFAULT_COMPRESSION)