Qore ConnectionProvider Module Reference  1.5
HttpConnection.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
2 // Qore HttpConnection class definition
3 
4 /* HttpConnection.qc Copyright 2016 - 2022 Qore Technologies, s.r.o.
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 
27 namespace ConnectionProvider {
29 
49 
50 public:
53  "cls": Class::forName("FilesystemConnection"),
54  "options": {
55  "assume_encoding": <ConnectionOptionInfo>{
56  "type": "string",
57  "desc": "assumes the given encoding if the server does not send a `charset` value",
58  },
59  "connect_timeout": <ConnectionOptionInfo>{
60  "type": "int",
61  "desc": "connection timeout to use in milliseconds (default: 45 seconds)",
62  "default_value": 45000,
63  },
64  "error_passthru": <ConnectionOptionInfo>{
65  "type": "bool",
66  "desc": "if `True` then HTTP status codes indicating errors will not cause an "
67  "`HTTP-CLIENT-RECEIVE-ERROR` exception to be raised, rather such responses will be "
68  "passed through to the caller like any other response",
69  "default_value": False,
70  },
71  "http_version": <ConnectionOptionInfo>{
72  "type": "string",
73  "desc": "HTTP version to use (`1.0` or `1.1`, defaults to `1.1`)",
74  "default_value": "1.1",
75  },
76  "max_redirects": <ConnectionOptionInfo>{
77  "type": "int",
78  "desc": "maximum redirects to support",
79  },
80  "proxy": <ConnectionOptionInfo>{
81  "type": "string",
82  "desc": "proxy URL to use",
83  },
84  "redirect_passthru": <ConnectionOptionInfo>{
85  "type": "bool",
86  "desc": "if `True` then redirect responses will be passed to the caller instead of processed",
87  "default_value": False,
88  },
89  "ssl_cert_data": <ConnectionOptionInfo>{
90  "type": "data",
91  "desc": "the X.509 certificate data in PEM format (string) or in DER format (binary); if this "
92  "option is set, then `ssl_cert_path` is ignored",
93  },
94  "ssl_cert_path": <ConnectionOptionInfo>{
95  "type": "string",
96  "desc": "a path to an X.509 client certificate file in PEM format",
97  "subst_env_vars": True,
98  },
99  "ssl_key_password": <ConnectionOptionInfo>{
100  "type": "string",
101  "desc": "the password to the private key given with `ssl_key_path`",
102  "sensitive": True,
103  },
104  "ssl_key_data": <ConnectionOptionInfo>{
105  "type": "data",
106  "desc": "the X.509 private key data in PEM format (string) or in DER format (binary); if this "
107  "option is set, then `ssl_key_path` is ignored",
108  },
109  "ssl_key_path": <ConnectionOptionInfo>{
110  "type": "string",
111  "desc": "a path to a private key file in PEM format for the X.509 client certificate",
112  "subst_env_vars": True,
113  },
114  "ssl_verify_cert": <ConnectionOptionInfo>{
115  "type": "bool",
116  "desc": "if `True` then the server's certificate will only be accepted if it's verified",
117  "default_value": False,
118  },
119  "timeout": <ConnectionOptionInfo>{
120  "type": "int",
121  "desc": "transfer timeout to use in milliseconds (default: 45 seconds)",
122  "default_value": 45000,
123  },
124  },
125  };
126 
128  const Options = map {$1: True}, keys ConnectionScheme.options;
129 
131  const DefaultOptions = ...;
132 
133 
135 
145  constructor(string name, string desc, string url, hash<auto> attributes = {}, hash<auto> options = {})
146  ;
147 
148 
150  string getType();
151 
152 
154 
158  DataProvider::AbstractDataProvider getDataProvider();
159 
160 
162 
167 
168 
170 
173 protected:
174  Qore::HTTPClient getImpl(bool connect = True, *hash<auto> rtopts);
175 public:
176 
177 
179 protected:
180  hash<ConnectionSchemeInfo> getConnectionSchemeInfoImpl();
181 public:
182 
183 };
184 }; // ConnectionProvider namespace
string desc
connection description
Definition: AbstractConnection.qc.dox.h:39
string url
connection URL (potentially with password info)
Definition: AbstractConnection.qc.dox.h:42
string name
connection name
Definition: AbstractConnection.qc.dox.h:36
abstract base class for connections
Definition: AbstractConnectionWithInfo.qc.dox.h:30
class for HTTP connections; returns Qore::HTTPClient objects
Definition: HttpConnection.qc.dox.h:48
DataProvider::AbstractDataProvider getDataProvider()
returns an HttpDataProvider object for this connection
hash< ConnectionSchemeInfo > getConnectionSchemeInfoImpl()
Returns the ConnectionSchemeInfo hash for this object.
bool hasDataProvider()
returns True, as the connection returns a data provider with the getDataProvider() method
const ConnectionScheme
Connection entry info.
Definition: HttpConnection.qc.dox.h:52
constructor(string name, string desc, string url, hash< auto > attributes={}, hash< auto > options={})
creates the HttpConnection object
Qore::HTTPClient getImpl(bool connect=True, *hash< auto > rtopts)
returns an Qore::HTTPClient object
string getType()
returns "http"
const Options
HttpConnection object connection options.
Definition: HttpConnection.qc.dox.h:128
const DefaultOptions
HttpConnection default options.
Definition: HttpConnection.qc.dox.h:131
const True
const False
the ConnectionProvider namespace. All classes used in the ConnectionProvider module should be inside ...
Definition: AbstractConnection.qc.dox.h:26
Connection option information.
Definition: ConnectionSchemeCache.qc.dox.h:38
Connection provider information.
Definition: ConnectionSchemeCache.qc.dox.h:59