7 <<
"ready: " << response->ready << std::endl
8 <<
"response: " << std::endl
9 << response->content << std::endl
10 <<
"error_code: " << response->error_code << std::endl
11 <<
"status_code: " << response->status_code << std::endl
12 <<
"retry_attempt: " << response->retry_attempt << std::endl
13 <<
"----------------------------------------" << std::endl;
27 int redirect_count = 15;
31 KURLYK_PRINT <<
"Sending GET request to /absolute-redirect/" << redirect_count <<
"..." << std::endl;
A client class for making HTTP requests to a specific host.
void set_rate_limit(long requests_per_period, long period_ms, RateLimitType type=RateLimitType::RL_GENERAL)
Sets the rate limit for HTTP requests.
void set_max_redirects(long max_redirects)
Sets the maximum number of redirects for the client.
void set_connect_timeout(long connect_timeout)
Sets the connection timeout duration.
void set_retry_attempts(long retry_attempts, long retry_delay_ms)
Sets retry attempts and delay between retries for HTTP requests.
void set_timeout(long timeout)
Sets the timeout duration for HTTP requests.
void set_user_agent(const std::string &user_agent)
Sets the User-Agent header.
bool get(const std::string &path, const QueryParams &query, const Headers &headers, HttpResponseCallback callback)
Sends a GET request.
void cancel_requests()
Cancels the active request associated with this client and waits for its completion.
Main header file for the Kurlyk library, providing HTTP and WebSocket support.
void init(const bool use_async=true)
Initializes the Kurlyk library, setting up necessary managers and the network worker.
std::unique_ptr< HttpResponse > HttpResponsePtr
A unique pointer to an HttpResponse object for memory management.
void deinit()
Deinitializes the Kurlyk library, stopping the network worker and releasing resources.
utils::CaseInsensitiveMultimap Headers
Alias for HTTP headers, providing a case-insensitive unordered multimap.
utils::CaseInsensitiveMultimap QueryParams
Alias for query parameters in HTTP requests, stored case-insensitively.
void print_response(const kurlyk::HttpResponsePtr &response)