This class represents the HTTP response created from the NetworkResponse and the request body.
More...
#include <HttpResponse.h>
This class represents the HTTP response created from the NetworkResponse and the request body.
◆ HttpResponse() [1/4]
| olp::client::HttpResponse::HttpResponse |
( |
int |
status, |
|
|
std::string |
response = {} |
|
) |
| |
|
inline |
Creates the HttpResponse instance.
- Parameters
-
| status | The HTTP status. |
| response | The response body. |
◆ HttpResponse() [2/4]
| olp::client::HttpResponse::HttpResponse |
( |
int |
status, |
|
|
std::stringstream && |
response |
|
) |
| |
|
inline |
Creates the HttpResponse instance.
- Parameters
-
| status | The HTTP status. |
| response | The response body. |
◆ HttpResponse() [3/4]
| olp::client::HttpResponse::HttpResponse |
( |
int |
status, |
|
|
std::stringstream && |
response, |
|
|
http::Headers |
headers |
|
) |
| |
|
inline |
Creates the HttpResponse instance.
- Parameters
-
| status | The HTTP status. |
| response | The response body. |
| headers | Response headers. |
◆ HttpResponse() [4/4]
| olp::client::HttpResponse::HttpResponse |
( |
const HttpResponse & |
other | ) |
|
|
inline |
A copy constructor.
This copy constructor creates a deep copy of the response body if a non-shareable container type is used.
- Parameters
-
| other | The instance of HttpStatus to copy from. |
◆ GetHeaders()
| const http::Headers & olp::client::HttpResponse::GetHeaders |
( |
| ) |
const |
|
inline |
Return the const reference to the response headers.
- Returns
- The const reference to the headers vector.
◆ GetNetworkStatistics()
◆ GetRawResponse()
| std::stringstream & olp::client::HttpResponse::GetRawResponse |
( |
| ) |
|
|
inline |
Return the reference to the response object.
- Returns
- The reference to the response object.
◆ GetResponse() [1/2]
| void olp::client::HttpResponse::GetResponse |
( |
std::string & |
output | ) |
const |
|
inline |
Copy HttpResponse content to a string.
- Parameters
-
| output | Reference to a string. |
◆ GetResponse() [2/2]
| void olp::client::HttpResponse::GetResponse |
( |
std::vector< unsigned char > & |
output | ) |
|
|
inline |
Copy HttpResponse content to a vector of unsigned chars.
- Parameters
-
| output | Reference to a vector. |
◆ GetResponseAsBytes()
| std::vector< unsigned char > olp::client::HttpResponse::GetResponseAsBytes |
( |
| ) |
|
|
inline |
Get the response body as a vector of unsigned chars.
- Returns
- The response body as a vector of unsigned chars.
◆ GetResponseAsString()
| std::string olp::client::HttpResponse::GetResponseAsString |
( |
| ) |
const |
|
inline |
Renders HttpResponse content to a string.
- Returns
- String representation of the response.
◆ GetStatus()
| int olp::client::HttpResponse::GetStatus |
( |
| ) |
const |
|
inline |
Return the response status.
The response status can either be an ErrorCode if negative or a HttpStatusCode if positive.
- Returns
- The response status.
◆ operator=()
A copy assignment operator.
This copy assignment operator creates a deep copy of the response body if a non-shareable container type is used.
- Parameters
-
| other | The instance of HttpStatus to copy from. |
◆ SetNetworkStatistics()
| void olp::client::HttpResponse::SetNetworkStatistics |
( |
NetworkStatistics |
network_statistics | ) |
|
|
inline |
The documentation for this class was generated from the following file: