8 #ifndef _UWSGI_REQUEST_H_
9 #define _UWSGI_REQUEST_H_
13 #include <unordered_map>
39 inline const std::string&
var(std::string key)
const {
40 auto it =
m_vars.find(key);
51 std::cout <<
"header:"
52 <<
" modifier1=" << (int)
m_header.modifier1 <<
" datasize=" <<
m_header.datasize
53 <<
" modifier2=" << (
int)
m_header.modifier2 << std::endl;
58 std::cout << kv.first <<
" = " << kv.second << std::endl;
119 #endif // _UWSGI_REQUEST_H_
void read_data(socket &sock)
Read request data from a socket.
void read_vars(socket &sock)
Read the uwsgi parameters from a socket.
tasks::tools::buffer m_data_buffer
std::unordered_map< std::string, std::string > uwsgi_vars_t
std::streamsize read(char *data, std::size_t size)
void print_header() const
static std::string NO_VAL
tasks::tools::buffer m_content_buffer
void read_header(socket &sock)
Read the header from a socket.
const uwsgi_vars_t & vars() const
The uwsgi protocol implementation for a request. The response is a HTTP/1.1 response.
uwsgi_packet_header & header()
void read_content(socket &sock)
Read POST data into the content buffer.
const std::string & var(std::string key) const
void clear()
Reset an object.
uwsgi_packet_header m_header
void write(const char *data, std::size_t size)
void parse_vars()
Parse the uswgi parameters into a hash map.