10 std::atomic<bool> running{
true};
13 std::thread processing_thread([&running](){
16 std::this_thread::sleep_for(std::chrono::milliseconds(100));
24 client.set_user_agent(
"KurlykClient/1.0");
25 client.set_timeout(10);
26 client.set_retry_attempts(3, 1000);
33 <<
"GET Response Content: " << response->content << std::endl
34 <<
"Status Code: " << response->status_code << std::endl;
35 if (response->ready) running =
false;
39 processing_thread.join();
41 KURLYK_PRINT <<
"Request processing completed. Exiting program." << std::endl;
Concrete HTTP client for making requests to a specific host.
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 async processing or cleaning up synchronous state.
utils::CaseInsensitiveMultimap Headers
Alias for HTTP headers, providing a case-insensitive unordered multimap.
void process()
Processes pending requests (used in synchronous mode).
utils::CaseInsensitiveMultimap QueryParams
Alias for query parameters in HTTP requests, stored case-insensitively.