olp-cpp-sdk
1.21.0
|
This class represents the HTTP response created from the NetworkResponse and the request body. More...
#include <HttpResponse.h>
Public Member Functions | |
HttpResponse (int status, std::string response={}) | |
Creates the HttpResponse instance. More... | |
HttpResponse (int status, std::stringstream &&response) | |
Creates the HttpResponse instance. More... | |
HttpResponse (int status, std::stringstream &&response, http::Headers headers) | |
Creates the HttpResponse instance. More... | |
HttpResponse (const HttpResponse &other) | |
A copy constructor. More... | |
HttpResponse & | operator= (const HttpResponse &other) |
A copy assignment operator. More... | |
HttpResponse (HttpResponse &&)=default | |
A default move constructor. | |
HttpResponse & | operator= (HttpResponse &&)=default |
A default move assignment operator. | |
void | GetResponse (std::vector< unsigned char > &output) |
Copy HttpResponse content to a vector of unsigned chars. More... | |
void | GetResponse (std::string &output) const |
Copy HttpResponse content to a string. More... | |
std::vector< unsigned char > | GetResponseAsBytes () |
Get the response body as a vector of unsigned chars. More... | |
std::string | GetResponseAsString () const |
Renders HttpResponse content to a string. More... | |
std::stringstream & | GetRawResponse () |
Return the reference to the response object. More... | |
const http::Headers & | GetHeaders () const |
Return the const reference to the response headers. More... | |
int | GetStatus () const |
Return the response status. More... | |
void | SetNetworkStatistics (NetworkStatistics network_statistics) |
Set NetworkStatistics . More... | |
const NetworkStatistics & | GetNetworkStatistics () const |
Get the NetworkStatistics . More... | |
This class represents the HTTP response created from the NetworkResponse and the request body.
|
inline |
Creates the HttpResponse
instance.
status | The HTTP status. |
response | The response body. |
|
inline |
Creates the HttpResponse
instance.
status | The HTTP status. |
response | The response body. |
|
inline |
Creates the HttpResponse
instance.
status | The HTTP status. |
response | The response body. |
headers | Response headers. |
|
inline |
A copy constructor.
This copy constructor creates a deep copy of the response body if a non-shareable container type is used.
other | The instance of HttpStatus to copy from. |
|
inline |
Return the const reference to the response headers.
|
inline |
Get the NetworkStatistics
.
NetworkStatistics
previously set.
|
inline |
Return the reference to the response object.
|
inline |
Copy HttpResponse
content to a string.
output | Reference to a string. |
|
inline |
Copy HttpResponse
content to a vector of unsigned chars.
output | Reference to a vector. |
|
inline |
Get the response body as a vector of unsigned chars.
|
inline |
Renders HttpResponse
content to a string.
|
inline |
Return the response status.
The response status can either be an ErrorCode
if negative or a HttpStatusCode
if positive.
|
inline |
A copy assignment operator.
This copy assignment operator creates a deep copy of the response body if a non-shareable container type is used.
other | The instance of HttpStatus to copy from. |
|
inline |
Set NetworkStatistics
.
network_statistics | Instance of NetworkStatistics . |