|
libtasks Documentation
1.6
|
The HTTP response implementation. More...
#include <http_response.h>


Public Member Functions | |
| http_response () | |
| void | set_status (std::string status) |
| const std::string & | status () const |
| int | status_code () const |
| void | prepare_data_buffer () |
| Prepare a HTTP request/response to be sent. More... | |
| void | read_data (net::socket &sock) |
| Read an HTTP response from a socket. More... | |
| void | clear () |
| Reset the http object. More... | |
Public Member Functions inherited from tasks::net::http_base | |
| http_base () | |
| virtual | ~http_base () |
| void | set_state (io_state state) |
| io_state | state () const |
| void | set_header (std::string header, std::string value) |
| const std::string & | header (std::string name) const |
| std::size_t | content_length () const |
| const char * | content_p () const |
| std::size_t | write (std::string s) |
| std::size_t | write (const std::string &s) |
| std::size_t | write (const char *data, std::size_t size) |
| std::size_t | read (char *data, std::size_t size) |
| std::istream & | content_istream () |
| std::ostream & | content_ostream () |
| void | write_data (socket &sock) |
| Write a HTTP object to a socket. More... | |
| void | print () const |
| bool | done () const |
Private Member Functions | |
| void | parse_data () |
| void | parse_line () |
| void | parse_status () |
| void | parse_header () |
Private Attributes | |
| std::string | m_status |
| int | m_status_code |
| int | m_line_number = 0 |
| std::size_t | m_last_line_start = 0 |
| std::size_t | m_content_start = 0 |
| bool | m_content_length_exists = false |
| bool | m_chunked_enc = false |
Additional Inherited Members | |
Static Public Attributes inherited from tasks::net::http_base | |
| static const std::string | NO_VAL |
Protected Member Functions inherited from tasks::net::http_base | |
| void | write_headers (socket &sock) |
| void | write_content (socket &sock) |
Protected Attributes inherited from tasks::net::http_base | |
| tasks::tools::buffer | m_data_buffer |
| tasks::tools::buffer | m_content_buffer |
| io_state | m_state = io_state::READY |
| std::unordered_map < std::string, std::string > | m_headers |
| std::size_t | m_content_length = 0 |
| std::istream | m_content_istream |
| std::ostream | m_content_ostream |
The HTTP response implementation.
Definition at line 19 of file http_response.h.
|
inline |
Definition at line 21 of file http_response.h.
|
inlinevirtual |
Reset the http object.
Reimplemented from tasks::net::http_base.
Definition at line 41 of file http_response.h.


|
private |
Definition at line 73 of file http_response.cpp.


|
private |
Definition at line 129 of file http_response.cpp.


|
private |
Definition at line 107 of file http_response.cpp.


|
private |
Definition at line 116 of file http_response.cpp.


|
virtual |
Prepare a HTTP request/response to be sent.
Implements tasks::net::http_base.
Definition at line 21 of file http_response.cpp.

| void tasks::net::http_response::read_data | ( | net::socket & | sock | ) |
Read an HTTP response from a socket.
Definition at line 40 of file http_response.cpp.

|
inline |
Definition at line 23 of file http_response.h.


|
inline |
Definition at line 29 of file http_response.h.

|
inline |
Definition at line 32 of file http_response.h.
|
private |
Definition at line 58 of file http_response.h.
|
private |
Definition at line 57 of file http_response.h.
|
private |
Definition at line 56 of file http_response.h.
|
private |
Definition at line 55 of file http_response.h.
|
private |
Definition at line 54 of file http_response.h.
|
private |
Definition at line 52 of file http_response.h.
|
private |
Definition at line 53 of file http_response.h.