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.
Public Member Functions | List of all members
web::http::details::_http_request Class Reference

Internal representation of an HTTP request message. More...

#include <http_msg.h>

Inheritance diagram for web::http::details::_http_request:
web::http::details::http_msg_base

Public Member Functions

_ASYNCRTIMP _http_request (http::method mtd)
 
_ASYNCRTIMP _http_request (std::unique_ptr< http::details::_http_server_context > server_context)
 
http::methodmethod ()
 
urirequest_uri ()
 
_ASYNCRTIMP uri absolute_uri () const
 
_ASYNCRTIMP uri relative_uri () const
 
_ASYNCRTIMP void set_request_uri (const uri &)
 
const pplx::cancellation_tokencancellation_token () const
 
void set_cancellation_token (const pplx::cancellation_token &token)
 
_ASYNCRTIMP utility::string_t to_string () const
 
_ASYNCRTIMP pplx::task< void > reply (const http_response &response)
 
pplx::task< http_responseget_response ()
 
_ASYNCRTIMP pplx::task< void > _reply_if_not_already (http::status_code status)
 
void set_response_stream (const concurrency::streams::ostream &stream)
 
void set_progress_handler (const progress_handler &handler)
 
const concurrency::streams::ostream & _response_stream () const
 
const std::shared_ptr< progress_handler > & _progress_handler () const
 
http::details::_http_server_context_get_server_context () const
 
void _set_server_context (std::unique_ptr< http::details::_http_server_context > server_context)
 
void _set_listener_path (const utility::string_t &path)
 
void _set_base_uri (const http::uri &base_uri)
 
- Public Member Functions inherited from web::http::details::http_msg_base
http_headersheaders ()
 
_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...
 

Detailed Description

Internal representation of an HTTP request message.


The documentation for this class was generated from the following file: