Seastar
High performance C++ framework for concurrent servers
|
handlers holds the logic for serving an incoming request. All handlers inherit from the base handler_base and implement the handle method.
#include <seastar/http/handlers.hh>
Public Member Functions | |
virtual future< std::unique_ptr< http::reply > > | handle (const sstring &path, std::unique_ptr< http::request > req, std::unique_ptr< http::reply > rep)=0 |
handler_base & | mandatory (const sstring ¶m) |
void | verify_mandatory_params (const http::request &req) const |
Protected Member Functions | |
handler_base (const handler_base &)=default | |
|
pure virtual |
All handlers should implement this method. It fill the reply according to the request.
path | the url path used in this call |
req | the original request |
rep | the reply |
Implemented in seastar::httpd::api_registry, seastar::httpd::api_registry_20, seastar::httpd::directory_handler, seastar::httpd::file_handler, and seastar::httpd::function_handler.
|
inline |
Add a mandatory parameter
param | a parameter name |
|
inline |
Check if all mandatory parameters exist in the request. if any param does not exist, the function would throw a missing_param_exception
params | req the http request |