tgbot-cpp
|
This class makes http requests. More...
#include <HttpClient.h>
Public Member Functions | |
virtual | ~HttpClient ()=default |
virtual std::string | makeRequest (const Url &url, const std::vector< HttpReqArg > &args) const =0 |
Sends a request to the url. | |
virtual int | getRequestMaxRetries () const |
Get the maximum number of makeRequest() retries before giving up and throwing an exception. | |
virtual int | getRequestBackoff () const |
Get the makeRequest() backoff duration between retries, in seconds. | |
Public Attributes | |
std::int32_t | _timeout = 25 |
This class makes http requests.
Definition at line 18 of file HttpClient.h.
|
virtualdefault |
|
inlinevirtual |
Get the makeRequest() backoff duration between retries, in seconds.
Definition at line 43 of file HttpClient.h.
|
inlinevirtual |
Get the maximum number of makeRequest() retries before giving up and throwing an exception.
Definition at line 36 of file HttpClient.h.
|
pure virtual |
Sends a request to the url.
If there's no args specified, a GET request will be sent, otherwise a POST request will be sent. If at least 1 arg is marked as file, the content type of a request will be multipart/form-data, otherwise it will be application/x-www-form-urlencoded.
Implemented in TgBot::BoostHttpOnlySslClient, and TgBot::CurlHttpClient.
std::int32_t TgBot::HttpClient::_timeout = 25 |
Definition at line 31 of file HttpClient.h.