A network response abstraction for the HTTP request.
More...
#include <NetworkResponse.h>
A network response abstraction for the HTTP request.
◆ GetBytesDownloaded()
uint64_t olp::http::NetworkResponse::GetBytesDownloaded |
( |
| ) |
const |
Gets the number of bytes downloaded during the associated network request.
- Returns
- The number of bytes downloaded during the associated network request.
◆ GetBytesUploaded()
uint64_t olp::http::NetworkResponse::GetBytesUploaded |
( |
| ) |
const |
Gets the number of bytes uploaded during the associated network request.
- Returns
- The number of bytes uploaded during the associated network request.
◆ GetDiagnostics()
const boost::optional<Diagnostics>& olp::http::NetworkResponse::GetDiagnostics |
( |
| ) |
const |
Gets the optional diagnostics if set.
- Returns
- Diagnostic values.
◆ GetError()
const std::string& olp::http::NetworkResponse::GetError |
( |
| ) |
const |
Gets the human-readable error message if the associated request failed.
- Returns
- The human-readable error message if the associated request failed.
◆ GetRequestId()
RequestId olp::http::NetworkResponse::GetRequestId |
( |
| ) |
const |
Gets the ID of the associated network request.
- Returns
- The ID of the associated network request.
◆ GetStatus()
int olp::http::NetworkResponse::GetStatus |
( |
| ) |
const |
Gets the HTTP response code.
- Returns
- The HTTP response code.
◆ IsCancelled()
bool olp::http::NetworkResponse::IsCancelled |
( |
| ) |
const |
Checks if the associated request was canceled.
- Returns
- True if the associated request was canceled; false otherwise.
◆ WithBytesDownloaded()
NetworkResponse& olp::http::NetworkResponse::WithBytesDownloaded |
( |
uint64_t |
bytes_downloaded | ) |
|
Sets the number of bytes downloaded during the associated network request.
- Parameters
-
[in] | bytes_downloaded | The number of downloaded bytes. |
- Returns
- A reference to *this.
◆ WithBytesUploaded()
NetworkResponse& olp::http::NetworkResponse::WithBytesUploaded |
( |
uint64_t |
bytes_uploaded | ) |
|
Sets the number of bytes uploaded during the associated network request.
- Parameters
-
[in] | bytes_uploaded | The number of uploaded bytes. |
- Returns
- A reference to *this.
◆ WithDiagnostics()
Sets the request diagnostics.
- Parameters
-
- Returns
- A reference to *this.
◆ WithError()
NetworkResponse& olp::http::NetworkResponse::WithError |
( |
std::string |
error | ) |
|
Sets the human-readable error message if the associated request failed.
- Parameters
-
[in] | error | The human-readable error message if the associated request failed. |
- Returns
- A reference to *this.
◆ WithRequestId()
Sets the ID of the associated network request.
- Parameters
-
[in] | id | The ID of the associated network request. |
- Returns
- A reference to *this.
◆ WithStatus()
Sets the HTTP response code.
- Parameters
-
[in] | status | The HTTP response code. |
- Returns
- A reference to *this.
The documentation for this class was generated from the following file: