Definition of mlib::http::server and mlib::http::connection classes.
More...
#include "tcpserver.h"
#include <string>
#include <map>
#include <deque>
#include <typeindex>
#include <filesystem>
Go to the source code of this file.
|
|
#define | HTTP_MAX_HEADER 8192 |
| | Maximum size of HTTP header.
|
| |
|
#define | HTTP_TIMEOUT 30s |
| | Default timeout interval while waiting for a client request.
|
| |
|
|
#define | HTTP_OK 0 |
| | Success.
|
| |
|
#define | HTTP_ERR_WRITE -1 |
| | Socket write failure.
|
| |
|
#define | HTTP_ERR_FOPEN -2 |
| | File open failure.
|
| |
|
#define | HTTP_ERR_FREAD -3 |
| | File read failure.
|
| |
|
#define | HTTP_NO_HANDLER -4 |
| | No handler found.
|
| |
|
#define | HTTP_CONTINUE 1 |
| | Continue serving page.
|
| |
|
| typedef std::map< std::string, std::string, ci_less > | mlib::http::str_pairs |
| |
|
typedef std::function< int(connection &client, void *info)> | mlib::http::uri_handler |
| | User defined URL handler function.
|
| |
◆ str_pairs
Key-value string pairs used for headers, URL-encoded data, etc. Keys are case insensitive.
◆ operator<<()
| std::ostream & mlib::http::operator<< |
( |
std::ostream & | os, |
|
|
const str_pairs & | hdrs ) |
|
inline |
Stream out a headers map as a sequence of lines.