#include <LibcurlHTTPCall.h>
LibCurl-based implementation of tenduke::http::HTTPCall.
|
virtual void | setRequestBody () |
| Sets request body to the CURL-call.
|
|
virtual void | setRequestHeaders () |
| Sets request headers to the CURL-call.
|
|
virtual void | setRequestMethod () |
| Sets request method to the CURL-call.
|
|
virtual void | setUrl () |
| Sets URL to the CURL-call.
|
|
|
const std::shared_ptr< const tenduke::http::HTTPRequest > | request |
| The request.
|
|
const std::unique_ptr< CURL, decltype(curl_easy_cleanup) * > | curlHandle |
| libcurl-handle for the request.
|
|
struct curl_slist * | curlHeaders |
| libcurl header-list.
|
|
const std::string | userAgent |
| Useragent-string to use.
|
|
bool | blindlyTrustSSLCertificates |
| If true, configure libcurl to blindly trust all SSL certificates.
|
|
bool | verbose |
| If true, configure libcurl to provide verbose output.
|
|
◆ LibCurlHTTPCall()
tenduke::http::curl::LibCurlHTTPCall::LibCurlHTTPCall |
( |
std::shared_ptr< const tenduke::http::HTTPRequest > |
request, |
|
|
std::string |
userAgent, |
|
|
bool |
blindlyTrustSSLCertificates = false , |
|
|
bool |
verbose = false |
|
) |
| |
Constructs new instance.
- Parameters
-
request | - |
userAgent | - |
blindlyTrustSSLCertificates | - |
verbose | - |
◆ execute()
Executes the call synchronously.
NOTE: This is blocking call.
- Returns
- HTTP-response.
- Exceptions
-
tenduke::net::NetworkingException | (or subclasses) when the call fails for various networking reasons like "no such host", "network timeout", "networking connection broken" and so on. Some of these are transient and thus re-triable, some indicate configuration error. |
tenduke::net::HTTPRequestException | when the call fails for various reasons, see documentation for the exception for details. NOTE HTTPCall does not throw exception if the request technically succeeds, but the server returns HTTP status code >= 400. It is responsibility of the caller to interpret the status code and act accordingly. |
Implements tenduke::http::HTTPCall.
The documentation for this class was generated from the following files:
- core/default-services/src/http/LibcurlHTTPCall.h
- core/default-services/src/http/LibcurlHTTPCall.cpp