Portable HTTPS GET client with zero external dependencies.
More...
#include <https_client.hpp>
Portable HTTPS GET client with zero external dependencies.
Uses platform-native APIs:
- macOS: Foundation framework (CFNetwork)
- Linux: OpenSSL (system library)
- Android: not currently implemented
- Windows: WinHTTP
Definition at line 18 of file https_client.hpp.
◆ HttpsClient() [1/2]
| Mads::HttpsClient::HttpsClient |
( |
| ) |
|
◆ ~HttpsClient()
| Mads::HttpsClient::~HttpsClient |
( |
| ) |
|
◆ HttpsClient() [2/2]
◆ add_query_pair()
| void Mads::HttpsClient::add_query_pair |
( |
const std::string & |
k, |
|
|
const std::string & |
v |
|
) |
| |
Add a query pair.
- Parameters
-
◆ get()
Perform HTTPS GET request to configured endpoint.
- Returns
- Response containing status code, message, and body
- Exceptions
-
| std::runtime_error | on network or system errors |
◆ operator=()
◆ query_string()
| std::string Mads::HttpsClient::query_string |
( |
| ) |
|
◆ set_hostname()
| void Mads::HttpsClient::set_hostname |
( |
const std::string & |
hostname | ) |
|
Set the remote hostname (without https:// prefix)
- Parameters
-
| hostname | e.g., "api.example.com" |
◆ set_path()
| void Mads::HttpsClient::set_path |
( |
const std::string & |
path | ) |
|
Set the API path on the remote server.
- Parameters
-
| path | e.g., "/v1/status" or "/api/data" |
◆ set_user_agent()
| void Mads::HttpsClient::set_user_agent |
( |
const std::string & |
user_agent | ) |
|
Set the User-Agent header.
- Parameters
-
| user_agent | e.g., "MyApp/1.0" |
The documentation for this class was generated from the following file: