8 KURLYK_PRINT <<
"Sending GET request using HttpClient method..." << std::endl;
13 <<
"Response from HttpClient method:" << std::endl
14 <<
"ready: " << response->ready << std::endl
15 <<
"content: " << response->content << std::endl
16 <<
"error_code: " << response->error_code << std::endl
17 <<
"status_code: " << response->status_code << std::endl
18 <<
"----------------------------------------" << std::endl;
20 KURLYK_PRINT <<
"Sending GET request using standalone function..." << std::endl;
21# if __cplusplus >= 201703L
25 uint64_t request_id = func_result.first;
26 auto future = std::move(func_result.second);
31 <<
"Response from standalone function:" << std::endl
32 <<
"Request ID: " << request_id << std::endl
33 <<
"Ready: " << std::boolalpha << response_func->ready << std::endl
34 <<
"Content: " << response_func->content << std::endl
35 <<
"Error Code: " << response_func->error_code.message() << std::endl
36 <<
"Status Code: " << response_func->status_code << std::endl
37 <<
"----------------------------------------" << std::endl;
A client class for making HTTP requests to a specific host.
bool get(const std::string &path, const QueryParams &query, const Headers &headers, HttpResponseCallback callback)
Sends a GET request.
Main header file for the Kurlyk library, providing HTTP and WebSocket support.
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.
uint64_t http_get(const std::string &url, const QueryParams &query, const Headers &headers, HttpResponseCallback callback)
Sends an asynchronous HTTP GET request with a callback.
utils::CaseInsensitiveMultimap QueryParams
Alias for query parameters in HTTP requests, stored case-insensitively.