Implementation of http::server and 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 | HTTPD_MAX_HEADER 8192 |
| Maximum size of HTTP header.
|
|
|
#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.
|
|
|
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.
|
|
Implementation of http::server and http::connection classes.
◆ 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.