Loading...
Searching...
No Matches
HttpClientDataProvider.qc.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
namespace HttpClientDataProvider {
class HttpClientDataProvider : public AbstractDataProvider {
public:
const ProviderInfo = <DataProviderInfo>{
"type": "HttpClientDataProvider",
"constructor_options": ConstructorOptions,
"supports_children": True,
"children_can_support_apis": True,
"children_can_support_records": False,
"children_can_support_observers": False,
};
const ConstructorOptions = {
"assume_encoding": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(StringType),
"desc": "Assumes the given encoding if the server does not send a `charset` value",
},
"connect_timeout": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(IntType),
"desc": "The connection timeout to use in milliseconds (default: 45 seconds)",
"default_value": 45000,
},
"error_passthru": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(BoolType),
"desc": "If `True` then HTTP status codes indicating errors will not cause an "
"`HTTP-CLIENT-RECEIVE-ERROR` exception to be raised, rather such responses will be "
"passed through to the caller like any other response",
"default_value": False,
},
"headers": <DataProviderOptionInfo>{
"type": AbstractDataProviderTypeMap."hash",
"desc": "headers to add in each outgoing request",
},
"http_version": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(StringType),
"desc": "HTTP version to use (`1.0` or `1.1`, defaults to `1.1`)",
"default_value": "1.1",
"allowed_values": (
<AllowedValueInfo>{
"value": "1.0",
"desc": "Use HTTP version \"1.0\"",
}, <AllowedValueInfo>{
"value": "1.1",
"desc": "Use HTTP version \"1.1\" (the default)",
},
),
},
"max_redirects": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(IntType),
"desc": "Maximum redirects to support",
},
"pre_encoded_urls": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(BoolType),
"desc": "if `true` then all URI paths in URLs are assumed to be already "
"[percent encoded](https://en.wikipedia.org/wiki/Percent-encoding); if this flag is set and "
"any unencoded characters are sent in a URL with a new request, an exception is raised",
"default_value": False,
},
"proxy": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(StringType),
"desc": "The proxy URL to use",
},
"redirect_passthru": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(BoolType),
"desc": "if `True` then redirect responses will be passed to the caller instead of processed",
"default_value": False,
},
"ssl_cert_der": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(BoolType),
"desc": "If `True` then the data represented by `ssl_cert_location` will be assumed to be in binary "
"DER format",
"default_value": False,
},
"ssl_cert_location": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(StringType, NOTHING, {
DTT_FromFile: True,
DTT_FromLocation: True,
}),
"desc": "A path or location to an X.509 client certificate file",
},
"ssl_key_der": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(BoolType),
"desc": "If `True` then the data represented by `ssl_key_location` will be assumed to be in binary "
"DER format",
"default_value": False,
},
"ssl_key_location": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(StringType, NOTHING, {
DTT_FromFile: True,
DTT_FromLocation: True,
}),
"desc": "A path or location to a private key file for the X.509 client certificate",
},
"ssl_key_password": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(StringType),
"desc": "The password to the private key given with `ssl_key_path` (text PEM format only)",
"sensitive": True,
},
"ssl_verify_cert": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(BoolType),
"desc": "if `True` then the server's certificate will only be accepted if it's verified",
"default_value": False,
},
"timeout": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(IntType),
"desc": "Transfer timeout to use in milliseconds (default: 45 seconds)",
"default_value": 45000,
},
"url": <DataProviderOptionInfo>{
"type": AbstractDataProviderType::get(StringType),
"desc": "A URL for an HTTP or HTTPS connection",
"required": True,
},
};
HTTPClient http;
protected:
const ChildMap = {
"call": Class::forName("HttpClientDataProvider::HttpClientCallDataProvider"),
"delete": Class::forName("HttpClientDataProvider::HttpClientDeleteDataProvider"),
"get": Class::forName("HttpClientDataProvider::HttpClientGetDataProvider"),
"head": Class::forName("HttpClientDataProvider::HttpClientHeadDataProvider"),
"options": Class::forName("HttpClientDataProvider::HttpClientOptionsDataProvider"),
"patch": Class::forName("HttpClientDataProvider::HttpClientPatchDataProvider"),
"post": Class::forName("HttpClientDataProvider::HttpClientPostDataProvider"),
"put": Class::forName("HttpClientDataProvider::HttpClientPutDataProvider"),
};
public:
constructor(*hash<auto> options);
constructor(HTTPClient http);
string getName();
*string getDesc();
*list<hash<DataProviderSummaryInfo>> getChildProviderSummaryInfo();
static HTTPClient getHttpConnection(hash<auto> options);
static hash<auto> makeRequest(HTTPClient http, string meth, *data body, string path, *hash<auto> hdr);
protected:
*list<string> getChildProviderNamesImpl();
public:
protected:
*AbstractDataProvider getChildProviderImpl(string name);
public:
protected:
hash<DataProviderInfo> getStaticInfoImpl();
public:
};
};
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.
HttpClientDataProvider
Qore HttpClientDataProvider module definition.
Definition: HttpClientCallDataProvider.qc.dox.h:26