Qore ConnectionProvider Module Reference  1.2
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 
43 
44 public:
46  const Options = {
47  "http_version": True,
48  "max_redirects": True,
49  "proxy": True,
50  "timeout": True,
51  "connect_timeout": True,
52  "ssl_cert_path": True,
53  "ssl_key_password": True,
54  "ssl_key_path": True,
55  "ssl_verify_cert": True,
56  };
57 
59  const DefaultOptions = {
60  "timeout": 45s,
61  "connect_timeout": 45s,
62  };
63 
64  const OptionList = Options.keys();
65 
67 
76  deprecated
77  constructor(string name, string desc, string url, bool monitor, *hash opts, hash urlh)
78  ;
79 
80 
82 
90  constructor(string name, string description, string url, hash attributes = {}, hash options = {})
91  ;
92 
93 
95 
98 protected:
99  Qore::HTTPClient getImpl(bool connect = True, *hash rtopts);
100 public:
101 
102 
104 
106 protected:
107  hash<ConnectionConstructorInfo> getConstructorInfoImpl();
108 public:
109 
110 
112 
125  hash getOptions();
126 
127 
129 
134 
135 
137  string getType();
138 
139 
141 
143  deprecated
144  static HttpConnection make(string name, string desc, string url, bool monitor, *hash opts, hash urlh);
145  };
146 }; // ConnectionProvider namespace
string getType()
returns "http"
bool monitor
monitoring flag
Definition: AbstractConnection.qc.dox.h:65
*hash opts
connection options
Definition: AbstractConnection.qc.dox.h:50
class for HTTP connections; returns Qore::HTTPClient objects
Definition: HttpConnection.qc.dox.h:42
const True
string name
connection name
Definition: AbstractConnection.qc.dox.h:35
hash urlh
broken down URL hash (as returned by Qore::parse_url())
Definition: AbstractConnection.qc.dox.h:53
abstract base class for connections
Definition: AbstractConnection.qc.dox.h:31
Qore::HTTPClient getImpl(bool connect=True, *hash rtopts)
returns an Qore::HTTPClient 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:59
string desc
connection description
Definition: AbstractConnection.qc.dox.h:38
hash< ConnectionConstructorInfo > getConstructorInfoImpl()
returns a hash that can be used to contruct the object dynamically
const Options
HttpConnection object connection options.
Definition: HttpConnection.qc.dox.h:46
string url
connection URL (potentially with password info)
Definition: AbstractConnection.qc.dox.h:41
deprecated constructor(string name, string desc, string url, bool monitor, *hash opts, hash urlh)
DEPRECATED: creates the HttpConnection object.
hash hash(object obj)
the ConnectionProvider namespace. All classes used in the ConnectionProvider module should be inside ...
Definition: AbstractConnection.qc.dox.h:27