tgbot-cpp
Loading...
Searching...
No Matches
TgBot::CurlHttpClient Class Reference

This class makes http requests via libcurl. More...

#include <CurlHttpClient.h>

Inheritance diagram for TgBot::CurlHttpClient:
TgBot::HttpClient

Public Member Functions

 CurlHttpClient ()
 
 ~CurlHttpClient () override
 
std::string makeRequest (const Url &url, const std::vector< HttpReqArg > &args) const override
 Sends a request to the url.
 
- Public Member Functions inherited from TgBot::HttpClient
virtual ~HttpClient ()=default
 
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

CURL * curlSettings
 Raw curl settings storage for fine tuning.
 
- Public Attributes inherited from TgBot::HttpClient
std::int32_t _timeout = 25
 

Detailed Description

This class makes http requests via libcurl.

Definition at line 23 of file CurlHttpClient.h.

Constructor & Destructor Documentation

◆ CurlHttpClient()

TgBot::CurlHttpClient::CurlHttpClient ( )

◆ ~CurlHttpClient()

TgBot::CurlHttpClient::~CurlHttpClient ( )
override

Member Function Documentation

◆ makeRequest()

std::string TgBot::CurlHttpClient::makeRequest ( const Url & url,
const std::vector< HttpReqArg > & args ) const
overridevirtual

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.

Implements TgBot::HttpClient.

Member Data Documentation

◆ curlSettings

CURL* TgBot::CurlHttpClient::curlSettings

Raw curl settings storage for fine tuning.

Definition at line 40 of file CurlHttpClient.h.


The documentation for this class was generated from the following file: