Qore YamlRpcClient Module Reference
1.0
Main Page
Classes
All
Classes
Functions
Variables
Pages
YamlRpcClient.qm.dox.h
1
// -*- mode: c++; indent-tabs-mode: nil -*-
3
4
/* YamlRpcClient.qm Copyright 2012 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
32
/* Version History
33
* 2012-05-24 v1.0: David Nichols <david@qore.org>: updated to a user module
34
*/
35
122
123
namespace
YamlRpcClient;
124
126
132
class
YamlRpcClient::YamlRpcClient
:
public
Qore::HTTPClient {
133
134
public
:
136
const
Version
=
"1.0"
;
137
139
const
DefaultOptions
= (
140
"protocols"
: (
141
"yamlrpc"
: (
142
"port"
: 80,
143
"ssl"
: False,
144
),
145
"yamlrpcs"
: (
146
"port"
: 443,
147
"ssl"
: True,
148
),
149
),
150
"default_path"
:
"YAML"
,
151
);
152
154
const
VersionString
= sprintf(
"Qore-YAML-RPC-Client/%s"
, YamlRpcClient::Version);
155
157
const
DefaultHeaders
= (
158
"Content-Type"
: MimeTypeYamlRpc +
";charset=utf-8"
,
159
"Accept"
: MimeTypeYamlRpc,
160
"User-Agent"
: YamlRpcClient::VersionString,
161
);
162
163
private
:
164
hash headers;
165
int
flags = YAML::None;
166
string
path;
167
168
public
:
169
171
182
constructor
(hash opts = hash(),
bool
do_not_connect = False);
183
184
186
188
constructor
(
bool
do_not_connect = False);
189
190
192
196
any
callArgs
(
string
method, any args);
197
198
200
205
any
callArgsWithInfo
(reference info,
string
method, any args);
206
207
209
212
any
call
(
string
method);
213
214
216
static
string
makeRequest
(
string
method, any arg,
int
flags = YAML::None);
217
};