This class makes http requests.
More...
#include <HttpClient.h>
|
| std::atomic< bool > | _isEternalCancel { false } |
| | Flag indicating whether the HTTP client is permanently disabled.
|
| std::atomic< uint64_t > | _cancelEpoch { 0 } |
| | Counter used to invalidate current requests.
|
This class makes http requests.
Definition at line 18 of file HttpClient.h.
◆ ~HttpClient()
| virtual TgBot::HttpClient::~HttpClient |
( |
| ) |
|
|
virtualdefault |
◆ cancel()
| virtual void TgBot::HttpClient::cancel |
( |
const bool | eternal = false | ) |
const |
|
inlinevirtual |
Cancels the requests.
- Parameters
-
| eternal | Optional. If true, permanently disables the HTTP client, canceling all current and future requests. If false, cancel the currently running requests. |
Definition at line 51 of file HttpClient.h.
◆ getCancelExceptionText()
| virtual const std::string & TgBot::HttpClient::getCancelExceptionText |
( |
| ) |
const |
|
inlinevirtual |
Get the exception message that occurs when the request is aborted.
Definition at line 69 of file HttpClient.h.
◆ getRequestBackoff()
| virtual int TgBot::HttpClient::getRequestBackoff |
( |
| ) |
const |
|
inlinevirtual |
◆ getRequestMaxRetries()
| virtual int TgBot::HttpClient::getRequestMaxRetries |
( |
| ) |
const |
|
inlinevirtual |
Get the maximum number of makeRequest() retries before giving up and throwing an exception.
Definition at line 34 of file HttpClient.h.
◆ isEternalCancelled()
| virtual bool TgBot::HttpClient::isEternalCancelled |
( |
| ) |
const |
|
inlinevirtual |
Checks if the HTTP client is permanently disabled.
Definition at line 62 of file HttpClient.h.
◆ makeRequest()
| virtual std::string TgBot::HttpClient::makeRequest |
( |
const std::string & | url, |
|
|
std::span< const HttpFormField > | fields ) const |
|
pure virtual |
Sends a request to the url.
If there are no fields, a GET request is sent. Otherwise, a multipart/form-data POST request is sent.
Implemented in TgBot::CurlHttpClient.
◆ _cancelEpoch
| std::atomic<uint64_t> TgBot::HttpClient::_cancelEpoch { 0 } |
|
mutableprotected |
Counter used to invalidate current requests.
Definition at line 82 of file HttpClient.h.
◆ _isEternalCancel
| std::atomic<bool> TgBot::HttpClient::_isEternalCancel { false } |
|
mutableprotected |
Flag indicating whether the HTTP client is permanently disabled.
Definition at line 77 of file HttpClient.h.
◆ _timeout
| std::int32_t TgBot::HttpClient::_timeout = 25 |
The documentation for this class was generated from the following file: