Public Member Functions |
| | http_response (const http_request &http_request_ptr) |
| | Constructs a new response object for a particular request.
|
| | http_response (const http_response &http_response) |
| | Copy constructor.
|
| virtual | ~http_response () STATICLIB_NOEXCEPT |
| | Virtual destructor.
|
| virtual void | clear () |
| | Clears all response data.
|
| virtual bool | is_content_length_implied () const |
| | The content length may be implied for certain types of responses.
|
| void | update_request_info (const http_request &http_request) |
| | Updates HTTP request information for the response object (use this if the response cannot be constructed using the request)
|
| void | set_status_code (unsigned int n) |
| | Sets the HTTP response status code.
|
| void | set_status_message (const std::string &msg) |
| | Sets the HTTP response status message.
|
| unsigned int | get_status_code () const |
| | Returns the HTTP response status code.
|
| const std::string & | get_status_message () const |
| | Returns the HTTP response status message.
|
| bool | is_body_allowed () const |
| | Returns true if this response can have a body.
|
| void | set_cookie (const std::string &name, const std::string &value) |
| | Sets a cookie by adding a Set-Cookie header (see RFC 2109) the cookie will be discarded by the user-agent when it closes.
|
| void | set_cookie (const std::string &name, const std::string &value, const std::string &path) |
| | Sets a cookie by adding a Set-Cookie header (see RFC 2109) the cookie will be discarded by the user-agent when it closes.
|
| void | set_cookie (const std::string &name, const std::string &value, const std::string &path, const unsigned long max_age) |
| | Sets a cookie by adding a Set-Cookie header (see RFC 2109)
|
| void | set_cookie (const std::string &name, const std::string &value, const unsigned long max_age) |
| | Sets a cookie by adding a Set-Cookie header (see RFC 2109)
|
| void | delete_cookie (const std::string &name) |
| | Deletes cookie called name by adding a Set-Cookie header (cookie has no path)
|
| void | delete_cookie (const std::string &name, const std::string &path) |
| | Deletes cookie called name by adding a Set-Cookie header (cookie has a path)
|
| void | set_last_modified (const unsigned long t) |
| | Sets the time that the response was last modified (Last-Modified)
|
| | 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.
|
| 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 | set_content (const std::string &content) |
| | Resets payload content to match the value of a string.
|
| 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 response information.