$darkmode

| Qore HttpClientDataProvider Module Reference 1.0.1

HttpClientDataProvider.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
26 namespace HttpClientDataProvider {
28 class HttpClientDataProvider : public AbstractDataProvider {
29
30 public:
32 const ProviderInfo = <DataProviderInfo>{
33 "type": "HttpClientDataProvider",
34 "constructor_options": ConstructorOptions,
35 "supports_children": True,
36 "children_can_support_apis": True,
37 "children_can_support_records": False,
38 "children_can_support_observers": False,
39 };
40
42 const ConstructorOptions = {
43 "assume_encoding": <DataProviderOptionInfo>{
44 "type": AbstractDataProviderType::get(StringType),
45 "desc": "Assumes the given encoding if the server does not send a `charset` value",
46 },
47 "connect_timeout": <DataProviderOptionInfo>{
48 "type": AbstractDataProviderType::get(IntType),
49 "desc": "The connection timeout to use in milliseconds (default: 45 seconds)",
50 "default_value": 45000,
51 },
52 "error_passthru": <DataProviderOptionInfo>{
53 "type": AbstractDataProviderType::get(BoolType),
54 "desc": "If `True` then HTTP status codes indicating errors will not cause an "
55 "`HTTP-CLIENT-RECEIVE-ERROR` exception to be raised, rather such responses will be "
56 "passed through to the caller like any other response",
57 "default_value": False,
58 },
59 "http_version": <DataProviderOptionInfo>{
60 "type": AbstractDataProviderType::get(StringType),
61 "desc": "HTTP version to use (`1.0` or `1.1`, defaults to `1.1`)",
62 "default_value": "1.1",
63 "allowed_values": (
64 <AllowedValueInfo>{
65 "value": "1.0",
66 "desc": "Use HTTP version \"1.0\"",
67 }, <AllowedValueInfo>{
68 "value": "1.1",
69 "desc": "Use HTTP version \"1.1\" (the default)",
70 },
71 ),
72 },
73 "max_redirects": <DataProviderOptionInfo>{
74 "type": AbstractDataProviderType::get(IntType),
75 "desc": "Maximum redirects to support",
76 },
77 "pre_encoded_urls": <DataProviderOptionInfo>{
78 "type": AbstractDataProviderType::get(BoolType),
79 "desc": "if `true` then all URI paths in URLs are assumed to be already "
80 "[percent encoded](https://en.wikipedia.org/wiki/Percent-encoding); if this flag is set and "
81 "any unencoded characters are sent in a URL with a new request, an exception is raised",
82 "default_value": False,
83 },
84 "proxy": <DataProviderOptionInfo>{
85 "type": AbstractDataProviderType::get(StringType),
86 "desc": "The proxy URL to use",
87 },
88 "redirect_passthru": <DataProviderOptionInfo>{
89 "type": AbstractDataProviderType::get(BoolType),
90 "desc": "if `True` then redirect responses will be passed to the caller instead of processed",
91 "default_value": False,
92 },
93 "ssl_cert_der": <DataProviderOptionInfo>{
94 "type": AbstractDataProviderType::get(BoolType),
95 "desc": "If `True` then the data represented by `ssl_cert_location` will be assumed to be in binary "
96 "DER format",
97 "default_value": False,
98 },
99 "ssl_cert_location": <DataProviderOptionInfo>{
100 "type": AbstractDataProviderType::get(StringType, NOTHING, {
101 DTT_FromFile: True,
102 DTT_FromLocation: True,
103 }),
104 "desc": "A path or location to an X.509 client certificate file",
105 },
106 "ssl_key_der": <DataProviderOptionInfo>{
107 "type": AbstractDataProviderType::get(BoolType),
108 "desc": "If `True` then the data represented by `ssl_key_location` will be assumed to be in binary "
109 "DER format",
110 "default_value": False,
111 },
112 "ssl_key_location": <DataProviderOptionInfo>{
113 "type": AbstractDataProviderType::get(StringType, NOTHING, {
114 DTT_FromFile: True,
115 DTT_FromLocation: True,
116 }),
117 "desc": "A path or location to a private key file for the X.509 client certificate",
118 },
119 "ssl_key_password": <DataProviderOptionInfo>{
120 "type": AbstractDataProviderType::get(StringType),
121 "desc": "The password to the private key given with `ssl_key_path` (text PEM format only)",
122 "sensitive": True,
123 },
124 "ssl_verify_cert": <DataProviderOptionInfo>{
125 "type": AbstractDataProviderType::get(BoolType),
126 "desc": "if `True` then the server's certificate will only be accepted if it's verified",
127 "default_value": False,
128 },
129 "timeout": <DataProviderOptionInfo>{
130 "type": AbstractDataProviderType::get(IntType),
131 "desc": "Transfer timeout to use in milliseconds (default: 45 seconds)",
132 "default_value": 45000,
133 },
134 "url": <DataProviderOptionInfo>{
135 "type": AbstractDataProviderType::get(StringType),
136 "desc": "A URL for an HTTP or HTTPS connection",
137 "required": True,
138 },
139 };
140
141 HTTPClient http;
142
143 protected:
144 const ChildMap = {
145 "call": Class::forName("HttpClientDataProvider::HttpClientCallDataProvider"),
146 "delete": Class::forName("HttpClientDataProvider::HttpClientDeleteDataProvider"),
147 "get": Class::forName("HttpClientDataProvider::HttpClientGetDataProvider"),
148 "head": Class::forName("HttpClientDataProvider::HttpClientHeadDataProvider"),
149 "options": Class::forName("HttpClientDataProvider::HttpClientOptionsDataProvider"),
150 "patch": Class::forName("HttpClientDataProvider::HttpClientPatchDataProvider"),
151 "post": Class::forName("HttpClientDataProvider::HttpClientPostDataProvider"),
152 "put": Class::forName("HttpClientDataProvider::HttpClientPutDataProvider"),
153 };
154
155 public:
156
158 constructor(*hash<auto> options);
159
160
162 constructor(HTTPClient http);
163
164
166 string getName();
167
168
170 *string getDesc();
171
172
174 *list<hash<DataProviderSummaryInfo>> getChildProviderSummaryInfo();
175
176
178 static HTTPClient getHttpConnection(hash<auto> options);
179
181 static hash<auto> makeRequest(HTTPClient http, string meth, *data body, string path, *hash<auto> hdr);
182
184
186 protected:
187 *list<string> getChildProviderNamesImpl();
188 public:
189
190
192
196 protected:
197 *AbstractDataProvider getChildProviderImpl(string name);
198 public:
199
200
202 protected:
203 hash<DataProviderInfo> getStaticInfoImpl();
204 public:
205
206};
207};
HttpClientDataProvider::HttpClientDataProvider::getChildProviderSummaryInfo
*list< hash< DataProviderSummaryInfo > > getChildProviderSummaryInfo()
Return data provider summary info.
HttpClientDataProvider::HttpClientDataProvider::getStaticInfoImpl
hash< DataProviderInfo > getStaticInfoImpl()
Returns data provider static info.
HttpClientDataProvider::HttpClientDataProvider::getDesc
*string getDesc()
Returns the data provider description.
HttpClientDataProvider::HttpClientDataProvider::constructor
constructor(*hash< auto > options)
Creates the object from constructor options.
HttpClientDataProvider::HttpClientDataProvider::getChildProviderNamesImpl
*list< string > getChildProviderNamesImpl()
Returns a list of child data provider names, if any.
HttpClientDataProvider::HttpClientDataProvider::getName
string getName()
Returns the data provider name.
HttpClientDataProvider::HttpClientDataProvider::getChildProviderImpl
*AbstractDataProvider getChildProviderImpl(string name)
Returns the given child provider or NOTHING if the given child is unknown.
HttpClientDataProvider::HttpClientDataProvider::constructor
constructor(HTTPClient http)
Creates the object from an HTTP connection.
HttpClientDataProvider::HttpClientDataProvider::getHttpConnection
static HTTPClient getHttpConnection(hash< auto > options)
Returns an HTTP connection.
HttpClientDataProvider::HttpClientDataProvider::makeRequest
static hash< auto > makeRequest(HTTPClient http, string meth, *data body, string path, *hash< auto > hdr)
Makes an HTTP request and returns the response.
True
const True
False
const False
NOTHING
const NOTHING
HttpClientDataProvider
Qore HttpClientDataProvider module definition.
Definition: HttpClientCallDataProvider.qc.dox.h:26