Qore ConnectionProvider Module Reference  1.3
HttpConnection.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
2 // Qore HttpConnection class definition
3 
4 /* HttpConnection.qc Copyright 2016 - 2019 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 
48 
49 public:
51  const Options = {
52  "error_passthru": True,
53  "http_version": True,
54  "max_redirects": True,
55  "proxy": True,
56  "timeout": True,
57  "connect_timeout": True,
58  "redirect_passthru": True,
59  "ssl_cert_path": True,
60  "ssl_key_password": True,
61  "ssl_key_path": True,
62  "ssl_verify_cert": True,
63  };
64 
66  const DefaultOptions = {
67  "timeout": 45s,
68  "connect_timeout": 45s,
69  };
70 
71  const OptionList = Options.keys();
72 
74 
83  deprecated
84  constructor(string name, string desc, string url, bool monitor, *hash<auto> opts, hash<auto> urlh)
85  ;
86 
87 
89 
97  constructor(string name, string desc, string url, hash<auto> attributes = {}, hash<auto> options = {})
98  ;
99 
100 
102 
105 protected:
106  Qore::HTTPClient getImpl(bool connect = True, *hash rtopts);
107 public:
108 
109 
111 
129  hash getOptions();
130 
131 
133 
138 
139 
141  string getType();
142 
143 
145 
147  deprecated
148  static HttpConnection make(string name, string desc, string url, bool monitor, *hash opts, hash urlh);
149  };
150 }; // ConnectionProvider namespace
string getType()
returns "http"
bool monitor
monitoring flag
Definition: AbstractConnection.qc.dox.h:65
class for HTTP connections; returns Qore::HTTPClient objects
Definition: HttpConnection.qc.dox.h:47
const True
string name
connection name
Definition: AbstractConnection.qc.dox.h:35
hash< auto > urlh
broken down URL hash (as returned by Qore::parse_url())
Definition: AbstractConnection.qc.dox.h:53
*hash< auto > opts
connection options
Definition: AbstractConnection.qc.dox.h:50
abstract base class for connections
Definition: AbstractConnection.qc.dox.h:31
Qore::HTTPClient getImpl(bool connect=True, *hash rtopts)
returns an Qore::HTTPClient object
deprecated constructor(string name, string desc, string url, bool monitor, *hash< auto > opts, hash< auto > urlh)
DEPRECATED: creates the HttpConnection object.
*hash getDefaultOptions()
returns default options
static deprecated HttpConnection make(string name, string desc, string url, bool monitor, *hash opts, hash urlh)
DEPRECATED: static constructor.
const DefaultOptions
HttpConnection default options.
Definition: HttpConnection.qc.dox.h:66
string desc
connection description
Definition: AbstractConnection.qc.dox.h:38
hash< auto > hash(object obj)
const Options
HttpConnection object connection options.
Definition: HttpConnection.qc.dox.h:51
string url
connection URL (potentially with password info)
Definition: AbstractConnection.qc.dox.h:41
the ConnectionProvider namespace. All classes used in the ConnectionProvider module should be inside ...
Definition: AbstractConnection.qc.dox.h:27