Qore YamlRpcClient Module Reference  1.0
YamlRpcClient.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* YamlRpcClient.qm Copyright 2012 - 2015 David Nichols
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23 */
24 
25 // minimum qore version
26 
27 // requires the binary yaml module
28 
29 // need mime definitions
30 
31 // do not use $ signs in declarations
32 
33 
34 /* Version History
35  * 2012-05-24 v1.0: David Nichols <david@qore.org>: updated to a user module
36 */
37 
124 namespace YamlRpcClient {}
126 
128 
134 class YamlRpcClient::YamlRpcClient : public Qore::HTTPClient {
135 
136 public:
138  const Version = "1.0";
139 
141  const DefaultOptions = (
142  "protocols": (
143  "yamlrpc": (
144  "port": 80,
145  "ssl": False,
146  ),
147  "yamlrpcs": (
148  "port": 443,
149  "ssl": True,
150  ),
151  ),
152  "default_path": "YAML",
153  );
154 
156  const VersionString = sprintf("Qore-YAML-RPC-Client/%s", YamlRpcClient::Version);
157 
159  const DefaultHeaders = (
160  "Content-Type": MimeTypeYamlRpc + ";charset=utf-8",
161  "Accept": MimeTypeYamlRpc,
162  "User-Agent": YamlRpcClient::VersionString,
163  );
164 
165  private :
166  hash headers;
167  int flags = YAML::None;
168  string path;
169 
170 public:
171 
173 
184  constructor(hash opts = hash(), bool do_not_connect = False);
185 
186 
188 
190  constructor(bool do_not_connect = False);
191 
192 
194 
198  any callArgs(string method, any args);
199 
200 
202 
207  any callArgsWithInfo(reference info, string method, any args);
208 
209 
211 
214  any call(string method);
215 
216 
218  static string makeRequest(string method, any arg, int flags = YAML::None);
219 };
const VersionString
YAML-RPC Client Version String.
Definition: YamlRpcClient.qm.dox.h:156
const Version
YAML-RPC Client Version.
Definition: YamlRpcClient.qm.dox.h:138
defines a YAML-RPC client class
Definition: YamlRpcClient.qm.dox.h:134
const DefaultOptions
default options for the YamlRpcClient::constructor()
Definition: YamlRpcClient.qm.dox.h:141
const DefaultHeaders
default HTTP headers
Definition: YamlRpcClient.qm.dox.h:159
any callArgs(string method, any args)
makes a call to the YAML-RPC server using the second argument as the list of arguments to send ...
static string makeRequest(string method, any arg, int flags=YAML::None)
makes a YAML-RPC request string
constructor(hash opts=hash(), bool do_not_connect=False)
calls the base class HTTPClient constructor, overrides the "protocols" key to "yamlrpc" ...
the YamlRpcClient namespace holds all public definitions in the YamlRpcClient module ...
Definition: YamlRpcClient.qm.dox.h:125
any callArgsWithInfo(reference info, string method, any args)
makes a call to the YAML-RPC server using the third argument as the list of arguments to send ...
any call(string method)
makes a method call to the YAML-RPC server using the remaining arguments after the method name as the...