Abstract interface for HTTP operations.
More...
#include <http_client.hpp>
|
| virtual HttpResponse | Get (const std::string &url, const Headers &headers)=0 |
| | Perform a GET request.
|
| virtual HttpResponse | Post (const std::string &url, const Headers &headers, const std::string &body)=0 |
| | Perform a POST request with a raw body.
|
| virtual void | Delay (unsigned long ms)=0 |
| | Delay execution for retry logic.
|
Abstract interface for HTTP operations.
◆ Delay()
| virtual void foresthub::core::HttpClient::Delay |
( |
unsigned long | ms | ) |
|
|
pure virtual |
Delay execution for retry logic.
- Parameters
-
| ms | Delay duration in milliseconds. |
◆ Get()
| virtual HttpResponse foresthub::core::HttpClient::Get |
( |
const std::string & | url, |
|
|
const Headers & | headers ) |
|
pure virtual |
Perform a GET request.
- Parameters
-
| url | Full URL to request. |
| headers | HTTP headers to send. |
- Returns
- HTTP response; status_code is 503 with a descriptive body on network-level failure.
◆ Post()
| virtual HttpResponse foresthub::core::HttpClient::Post |
( |
const std::string & | url, |
|
|
const Headers & | headers, |
|
|
const std::string & | body ) |
|
pure virtual |
Perform a POST request with a raw body.
- Parameters
-
| url | Full URL to request. |
| headers | HTTP headers to send. |
| body | Raw request body (typically JSON string). |
- Returns
- HTTP response; status_code is 503 with a descriptive body on network-level failure.
The documentation for this class was generated from the following file: