Public Member Functions |
| | http_request () |
| | Constructs a new request object (default constructor)
|
| | http_request (const http_request &) |
| | Deleted copy constructor.
|
| http_request & | operator= (const http_request &) |
| | Deleted copy-assignment operator.
|
| virtual | ~http_request () STATICLIB_NOEXCEPT |
| | Virtual destructor.
|
| virtual void | clear () |
| | Clears all request data.
|
| virtual bool | is_content_length_implied () const |
| | The content length of the message can never be implied for requests.
|
| const std::string & | get_method () const |
| | Returns the request method (i.e.
|
| const std::string & | get_resource () const |
| | Returns the resource uri-stem to be delivered (possibly the result of a redirect)
|
| const std::string & | get_original_resource () const |
| | Returns the resource uri-stem originally requested.
|
| const std::string & | get_query_string () const |
| | Returns the uri-query or query string requested.
|
| const std::string & | get_query (const std::string &key) const |
| | Returns a value for the query key if any are defined; otherwise, an empty string.
|
std::unordered_multimap
< std::string, std::string,
algorithm::ihash,
algorithm::iequal_to > & | get_queries () |
| | Returns the query parameters.
|
| bool | has_query (const std::string &key) const |
| | Returns true if at least one value for the query key is defined.
|
| void | set_method (const std::string &str) |
| | Sets the HTTP request method (i.e.
|
| void | set_resource (const std::string &str) |
| | Sets the resource or uri-stem originally requested.
|
| void | change_resource (const std::string &str) |
| | Changes the resource or uri-stem to be delivered (called as the result of a redirect)
|
| void | set_query_string (const std::string &str) |
| | Sets the uri-query or query string requested.
|
| void | add_query (const std::string &key, const std::string &value) |
| | Adds a value for the query key.
|
| void | change_query (const std::string &key, const std::string &value) |
| | Changes the value of a query key.
|
| void | delete_query (const std::string &key) |
| | Removes all values for a query key.
|
| void | use_query_params_for_query_string () |
| | Use the query parameters to build a query string for the request.
|
| void | use_query_params_for_post_content () |
| | Use the query parameters to build POST content for the request.
|
| void | set_content (const std::string &value) |
| | Add content (for POST) from string.
|
| void | set_content (const char *value, size_t size) |
| | Add content (for POST) from buffer of given size; Does nothing if the buffer is invalid or the buffer size is zero.
|
| void | set_payload_handler (http_parser::payload_handler_type ph) |
| | This method should be called from payload_handler_creator to stick payload handler to this request.
|
| template<typename T > |
| T * | get_payload_handler () |
| | Access to the wrapped payload handler object.
|
| http_parser::payload_handler_type & | get_payload_handler_wrapper () |
| | Access to the payload handler wrapper.
|
| void | set_request_reader (http_parser *rr) |
| | Internal method used with payload handlers.
|
| | http_message () |
| | Constructs a new HTTP message object.
|
| | http_message (const http_message &http_msg) |
| | Copy constructor.
|
| http_message & | operator= (const http_message &http_msg) |
| | Assignment operator.
|
| virtual | ~http_message () STATICLIB_NOEXCEPT |
| | Virtual destructor.
|
| bool | is_valid () const |
| | Returns true if the message is valid.
|
| bool | get_chunks_supported () const |
| | Returns true if chunked transfer encodings are supported.
|
| const asio::ip::address & | get_remote_ip () const |
| | Returns IP address of the remote endpoint.
|
| uint16_t | get_version_major () const |
| | Returns the major HTTP version number.
|
| uint16_t | get_version_minor () const |
| | Returns the minor HTTP version number.
|
| std::string | get_version_string () const |
| | Returns a string representation of the HTTP version (i.e.
|
| size_t | get_content_length () const |
| | Returns the length of the payload content (in bytes)
|
| bool | is_chunked (void) const |
| | Returns true if the message content is chunked.
|
| bool | is_content_buffer_allocated () const |
| | Returns true if buffer for content is allocated.
|
| std::size_t | get_content_buffer_size () const |
| | Returns size of allocated buffer.
|
| char * | get_content () |
| | Returns a pointer to the payload content, or empty string if there is none.
|
| const char * | get_content () const |
| | Returns a const pointer to the payload content, or empty string if there is none.
|
| std::vector< char > & | get_chunk_cache () |
| | Returns a reference to the chunk cache.
|
| const std::string & | get_header (const std::string &key) const |
| | Returns a value for the header if any are defined; otherwise, an empty string.
|
| bool | has_header_value (const std::string &key, const std::string &value) const |
| headers_type & | get_headers () |
| | Returns a reference to the HTTP headers multimap.
|
| bool | has_header (const std::string &key) const |
| | Returns true if at least one value for the header is defined.
|
| const std::string & | get_cookie (const std::string &key) const |
| | Returns a value for the cookie if any are defined; otherwise, an empty string since cookie names are insensitive, key should use lowercase alpha chars.
|
| headers_type & | get_cookies () |
| | Returns the cookie parameters.
|
| bool | has_cookie (const std::string &key) const |
| | Returns true if at least one value for the cookie is defined since cookie names are insensitive, key should use lowercase alpha chars.
|
| void | add_cookie (const std::string &key, const std::string &value) |
| | Adds a value for the cookie since cookie names are insensitive, key should use lowercase alpha chars.
|
| void | change_cookie (const std::string &key, const std::string &value) |
| | Changes the value of a cookie since cookie names are insensitive, key should use lowercase alpha chars.
|
| void | delete_cookie (const std::string &key) |
| | Removes all values for a cookie since cookie names are insensitive, key should use lowercase alpha chars.
|
| const std::string & | get_first_line () const |
| | Returns a string containing the first line for the HTTP message.
|
| bool | has_missing_packets () const |
| | Returns true if there were missing packets.
|
| void | set_missing_packets (bool newVal) |
| | Set to true when missing packets detected.
|
| bool | has_data_after_missing_packets () const |
| | Returns true if more data seen after the missing packets.
|
| void | set_data_after_missing_packet (bool newVal) |
| | Sets data seen after the missing packets flag.
|
| void | set_is_valid (bool b=true) |
| | Sets whether or not the message is valid.
|
| void | set_chunks_supported (bool b) |
| | Set to true if chunked transfer encodings are supported.
|
| void | set_remote_ip (const asio::ip::address &ip) |
| | Sets IP address of the remote endpoint.
|
| void | set_version_major (const uint16_t n) |
| | Sets the major HTTP version number.
|
| void | set_version_minor (const uint16_t n) |
| | Sets the minor HTTP version number.
|
| void | set_content_length (size_t n) |
| | Sets the length of the payload content (in bytes)
|
| void | set_do_not_send_content_length () |
| | If called, the content-length will not be sent in the HTTP headers.
|
| data_status_type | get_status () const |
| | Return the data receival status.
|
| void | set_status (data_status_type newVal) |
| | Sets data receival status.
|
| void | update_content_length_using_header () |
| | Sets the length of the payload content using the Content-Length header.
|
| void | update_transfer_encoding_using_header () |
| | Sets the transfer coding using the Transfer-Encoding header.
|
| char * | create_content_buffer () |
| | Creates a payload content buffer of size m_content_length and returns a pointer to the new buffer (memory is managed by message class)
|
| void | clear_content () |
| | Clears payload content buffer.
|
| void | set_content_type (const std::string &type) |
| | Sets the content type for the message payload.
|
| void | add_header (const std::string &key, const std::string &value) |
| | Adds a value for the HTTP header named key.
|
| void | change_header (const std::string &key, const std::string &value) |
| | Changes the value for the HTTP header named key.
|
| void | delete_header (const std::string &key) |
| | Removes all values for the HTTP header named key.
|
| bool | check_keep_alive () const |
| | Returns true if the HTTP connection may be kept alive.
|
| void | prepare_buffers_for_send (std::vector< asio::const_buffer > &write_buffers, const bool keep_alive, const bool using_chunks) |
| | Initializes a vector of write buffers with the HTTP message information.
|
| void | concatenate_chunks () |
| | Pieces together all the received chunks.
|
Container for HTTP request information.