C++ Rest SDK
The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
|
Internal representation of an HTTP response. More...
#include <http_msg.h>
Public Member Functions | |
_http_response (http::status_code code) | |
http::status_code | status_code () const |
void | set_status_code (http::status_code code) |
const http::reason_phrase & | reason_phrase () const |
void | set_reason_phrase (const http::reason_phrase &reason) |
_ASYNCRTIMP utility::string_t | to_string () const |
_http_server_context * | _get_server_context () const |
void | _set_server_context (std::unique_ptr< details::_http_server_context > server_context) |
Public Member Functions inherited from web::http::details::http_msg_base | |
http_headers & | headers () |
_ASYNCRTIMP void | set_body (const concurrency::streams::istream &instream, const utf8string &contentType) |
_ASYNCRTIMP void | set_body (const concurrency::streams::istream &instream, const utf16string &contentType) |
_ASYNCRTIMP void | set_body (const concurrency::streams::istream &instream, utility::size64_t contentLength, const utf8string &contentType) |
_ASYNCRTIMP void | set_body (const concurrency::streams::istream &instream, utility::size64_t contentLength, const utf16string &contentType) |
utility::string_t | parse_and_check_content_type (bool ignore_content_type, const std::function< bool(const utility::string_t &)> &check_content_type) |
Helper function for extract functions. Parses the Content-Type header and check to make sure it matches, throws an exception if not. More... | |
_ASYNCRTIMP utf8string | extract_utf8string (bool ignore_content_type=false) |
_ASYNCRTIMP utf16string | extract_utf16string (bool ignore_content_type=false) |
_ASYNCRTIMP utility::string_t | extract_string (bool ignore_content_type=false) |
_ASYNCRTIMP json::value | _extract_json (bool ignore_content_type=false) |
_ASYNCRTIMP std::vector< unsigned char > | _extract_vector () |
virtual _ASYNCRTIMP void | _complete (utility::size64_t bodySize, const std::exception_ptr &exceptionPtr=std::exception_ptr()) |
Completes this message More... | |
void | set_instream (const concurrency::streams::istream &instream) |
Set the stream through which the message body could be read More... | |
const concurrency::streams::istream & | instream () const |
Get the stream through which the message body could be read More... | |
void | set_outstream (const concurrency::streams::ostream &outstream, bool is_default) |
Set the stream through which the message body could be written More... | |
const concurrency::streams::ostream & | outstream () const |
Get the stream through which the message body could be written More... | |
const pplx::task_completion_event< utility::size64_t > & | _get_data_available () const |
_ASYNCRTIMP void | _prepare_to_receive_data () |
Prepare the message with an output stream to receive network data More... | |
_ASYNCRTIMP size_t | _get_content_length () |
Determine the content length More... | |
Additional Inherited Members | |
Protected Attributes inherited from web::http::details::http_msg_base | |
concurrency::streams::istream | m_inStream |
Stream to read the message body. By default this is an invalid stream. The user could set the instream on a request by calling set_request_stream(...). This would also be set when set_body() is called - a stream from the body is constructed and set. Even in the presense of msg body this stream could be invalid. An example would be when the user sets an ostream for the response. With that API the user does not provide the ability to read the msg body. Thus m_instream is valid when there is a msg body and it can actually be read More... | |
concurrency::streams::ostream | m_outStream |
stream to write the msg body By default this is an invalid stream. The user could set this on the response (for http_client). In all the other cases we would construct one to transfer the data from the network into the message body. More... | |
http_headers | m_headers |
bool | m_default_outstream |
pplx::task_completion_event< utility::size64_t > | m_data_available |
The TCE is used to signal the availability of the message body. More... | |
Internal representation of an HTTP response.