SNode.C
|
#include <Request.h>
Public Member Functions | |
Request ()=default | |
Request (const std::shared_ptr< web::http::server::Request > &request) noexcept | |
Request (Request &)=delete | |
Request (Request &&) noexcept=delete | |
Request & | operator= (Request &)=delete |
Request & | operator= (Request &&) noexcept=delete |
const std::string & | param (const std::string &id, const std::string &fallBack="") |
const std::string & | get (const std::string &key, int i=0) const |
const std::string & | cookie (const std::string &key) const |
const std::string & | query (const std::string &key) const |
![]() | |
template<InjectableAttribute Attribute, fixed_string key = ""> | |
constexpr bool | setAttribute (const Attribute &attribute, const std::string &subKey="", bool overwrite=false) |
template<InjectableAttribute Attribute, fixed_string key = ""> | |
constexpr bool | setAttribute (const Attribute &&attribute, const std::string &subKey="", bool overwrite=false) |
template<InjectableAttribute Attribute, fixed_string key = ""> | |
constexpr bool | delAttribute (const std::string &subKey="") |
template<InjectableAttribute Attribute, fixed_string key = ""> | |
constexpr bool | hasAttribute (const std::string &subKey="") const |
template<InjectableAttribute Attribute, fixed_string key = ""> | |
bool | getAttribute (const std::function< void(Attribute &)> &onFound, const std::string &subKey="") const |
template<InjectableAttribute Attribute, fixed_string key = ""> | |
void | getAttribute (const std::function< void(Attribute &)> &onFound, const std::function< void(const std::string &)> &onNotFound, const std::string &subKey="") const |
void | reset () |
Public Attributes | |
std::string | originalUrl |
std::string | path |
std::string | file |
std::map< std::string, std::string > | params |
std::string | method |
std::string | url |
std::string | httpVersion |
int | httpMajor = 0 |
int | httpMinor = 0 |
web::http::CiStringMap< std::string > | queries |
web::http::CiStringMap< std::string > | headers |
web::http::CiStringMap< std::string > | cookies |
std::vector< char > | body |
Private Member Functions | |
Request & | extend () |
Private Attributes | |
std::shared_ptr< web::http::server::Request > | requestBase |
std::string | nullstr |
Friends | |
class | Response |
|
default |
|
explicitnoexcept |
Definition at line 57 of file Request.cpp.
References body, web::http::server::Request::body, cookies, web::http::server::Request::cookies, extend(), headers, web::http::server::Request::headers, httpMajor, web::http::server::Request::httpMajor, httpMinor, web::http::server::Request::httpMinor, httpVersion, web::http::server::Request::httpVersion, method, web::http::server::Request::method, queries, web::http::server::Request::queries, requestBase, url, and web::http::server::Request::url.
|
explicitdelete |
|
explicitdeletenoexcept |
const std::string & express::Request::cookie | ( | const std::string & | key | ) | const |
Definition at line 97 of file Request.cpp.
|
private |
Definition at line 75 of file Request.cpp.
References file, originalUrl, path, httputils::str_split_last(), url, and httputils::url_decode().
Referenced by Request().
const std::string & express::Request::get | ( | const std::string & | key, |
int | i = 0 |
||
) | const |
Definition at line 93 of file Request.cpp.
References web::http::server::Request::get(), and requestBase.
Referenced by express::middleware::BasicAuthentication::BasicAuthentication(), main(), and express::middleware::VHost::VHost().
const std::string & express::Request::param | ( | const std::string & | id, |
const std::string & | fallBack = "" |
||
) |
Definition at line 71 of file Request.cpp.
References params.
Referenced by main().
const std::string & express::Request::query | ( | const std::string & | key | ) | const |
Definition at line 107 of file Request.cpp.
References nullstr, and queries.
Referenced by main().
std::vector<char> express::Request::body |
Definition at line 104 of file Request.h.
Referenced by express::middleware::JsonMiddleware::JsonMiddleware(), main(), Request(), and express::middleware::VerboseRequest::VerboseRequest().
web::http::CiStringMap<std::string> express::Request::cookies |
Definition at line 103 of file Request.h.
Referenced by cookie(), Request(), and express::middleware::VerboseRequest::VerboseRequest().
web::http::CiStringMap<std::string> express::Request::headers |
Definition at line 102 of file Request.h.
Referenced by Request(), and express::middleware::VerboseRequest::VerboseRequest().
int express::Request::httpMajor = 0 |
int express::Request::httpMinor = 0 |
std::string express::Request::httpVersion |
Definition at line 97 of file Request.h.
Referenced by Request(), and express::middleware::VerboseRequest::VerboseRequest().
std::string express::Request::method |
Definition at line 95 of file Request.h.
Referenced by express::dispatcher::ApplicationDispatcher::dispatch(), express::dispatcher::MiddlewareDispatcher::dispatch(), express::dispatcher::RouterDispatcher::dispatch(), Request(), express::middleware::StaticMiddleware::StaticMiddleware(), and express::middleware::VerboseRequest::VerboseRequest().
|
private |
std::string express::Request::originalUrl |
std::map<std::string, std::string> express::Request::params |
Definition at line 79 of file Request.h.
Referenced by param(), and express::dispatcher::setParams().
std::string express::Request::path |
Definition at line 77 of file Request.h.
Referenced by express::dispatcher::ApplicationDispatcher::dispatch(), express::dispatcher::MiddlewareDispatcher::dispatch(), express::dispatcher::RouterDispatcher::dispatch(), and extend().
web::http::CiStringMap<std::string> express::Request::queries |
Definition at line 101 of file Request.h.
Referenced by query(), Request(), and express::middleware::VerboseRequest::VerboseRequest().
|
private |
Definition at line 84 of file Request.h.
Referenced by get(), Request(), and express::Response::upgrade().
std::string express::Request::url |
Definition at line 96 of file Request.h.
Referenced by express::dispatcher::ApplicationDispatcher::dispatch(), express::dispatcher::MiddlewareDispatcher::dispatch(), express::dispatcher::RouterDispatcher::dispatch(), extend(), main(), Request(), express::dispatcher::setParams(), express::middleware::StaticMiddleware::StaticMiddleware(), and express::middleware::VerboseRequest::VerboseRequest().