|
ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
|
Parsed HTTP request. More...
#include <src/tooling/query/http_server.h>
Public Member Functions | |
| std::string | param (const std::string &name, const std::string &default_value="") const |
| Get a query parameter value. | |
| bool | hasParam (const std::string &name) const |
| Check if a query parameter exists (flag-style, like &break) | |
| int | paramInt (const std::string &name, int default_value=0) const |
| Get a query parameter as integer. | |
| std::string | header (const std::string &name, const std::string &default_value="") const |
| Get a header value. | |
Data Fields | |
| std::string | method |
| GET, POST, etc. | |
| std::string | path |
| Request path (without query string) | |
| std::string | query_string |
| Query string (after ?) | |
| std::unordered_map< std::string, std::string > | headers |
| Request headers. | |
| std::unordered_map< std::string, std::string > | params |
| Parsed query parameters. | |
| std::string | body |
| Request body. | |
Parsed HTTP request.
Definition at line 37 of file http_server.h.
|
inline |
Check if a query parameter exists (flag-style, like &break)
| name | Parameter name |
Definition at line 61 of file http_server.h.
References params.
| std::string ascii_query::HttpRequest::header | ( | const std::string & | name, |
| const std::string & | default_value = "" |
||
| ) | const |
Get a header value.
| name | Header name (case-insensitive) |
| default_value | Default if not found |
Definition at line 41 of file http_server.cpp.
References headers.
|
inline |
Get a query parameter value.
| name | Parameter name |
| default_value | Default if not found |
Definition at line 51 of file http_server.h.
References params.
|
inline |
Get a query parameter as integer.
| name | Parameter name |
| default_value | Default if not found or not a number |
Definition at line 71 of file http_server.h.
References params.
| std::string ascii_query::HttpRequest::body |
Request body.
Definition at line 43 of file http_server.h.
| std::unordered_map<std::string, std::string> ascii_query::HttpRequest::headers |
| std::string ascii_query::HttpRequest::method |
GET, POST, etc.
Definition at line 38 of file http_server.h.
| std::unordered_map<std::string, std::string> ascii_query::HttpRequest::params |
Parsed query parameters.
Definition at line 42 of file http_server.h.
Referenced by hasParam(), param(), and paramInt().
| std::string ascii_query::HttpRequest::path |
Request path (without query string)
Definition at line 39 of file http_server.h.
| std::string ascii_query::HttpRequest::query_string |
Query string (after ?)
Definition at line 40 of file http_server.h.