http_response Class
Represents an HTTP response.
Warning
This topic contains information for the C++ REST SDK 1.0 (codename "Casablanca"). If you are using a later version from the Codeplex Casablanca web page, then use the local documentation at http://casablanca.codeplex.com/documentation.
class http_response;
Members
Public Constructors
Name |
Description |
---|---|
Overloaded. Constructs a response with an empty status code, no headers, and no body. |
Public Methods
Name |
Description |
---|---|
Produces a stream which the caller may use to retrieve data from an incoming request. |
|
Signals the user (client) when all the data for this response message has been received. |
|
Gets the error code of the response. This is used for errors other than HTTP status codes. |
|
Extracts the body of the response message into a json value, checking that the content type is application\json. A body can only be extracted once because in some cases an optimization is made where the data is 'moved' out. |
|
Extracts the body of the response message as a string value, checking that the content type is a MIME text type. A body can only be extracted once because in some cases an optimization is made where the data is 'moved' out. |
|
Extracts the body of the response message into a vector of bytes. |
|
Overloaded. Gets the headers of the response message. |
|
Gets the reason phrase of the response message. If no reason phrase is set it will default to the standard one corresponding to the status code. |
|
Overloaded. Sets the body of the message to a textual string and set the "Content-Type" header. Assumes the character encoding of the string is the OS's default code page and will perform appropriate conversions to UTF-8. |
|
Sets the error code of the response. This is used for errors other than HTTP status codes. |
|
Sets the reason phrase of the response message. If no reason phrase is set it will default to the standard one corresponding to the status code. |
|
Sets the status code of the response message. |
|
Gets the status code of the response message. |
|
Generates a string representation of the message, including the body when possible. |
Public Operators
Name |
Description |
---|---|
Assignment operator. |
Requirements
Header: http_msg.h
Namespace: web::http