Seastar
High performance C++ framework for concurrent servers
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
seastar::httpd::handler_base Class Referenceabstract

Detailed Description

handlers holds the logic for serving an incoming request. All handlers inherit from the base httpserver_handler and implement the handle method.

#include <seastar/http/handlers.hh>

Inheritance diagram for seastar::httpd::handler_base:
seastar::httpd::api_registry_base seastar::httpd::file_interaction_handler seastar::httpd::function_handler seastar::httpd::api_registry seastar::httpd::api_registry_20 seastar::httpd::directory_handler seastar::httpd::file_handler

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_basemandatory (const sstring &param)
 

Public Attributes

std::vector< sstring > _mandatory_param
 

Protected Member Functions

 handler_base (const handler_base &)=default
 

Member Function Documentation

◆ handle()

virtual future<std::unique_ptr<http::reply> > seastar::httpd::handler_base::handle ( const sstring &  path,
std::unique_ptr< http::request req,
std::unique_ptr< http::reply rep 
)
pure virtual

All handlers should implement this method. It fill the reply according to the request.

Parameters
paththe url path used in this call
reqthe original request
repthe reply

Implemented in seastar::httpd::function_handler, seastar::httpd::file_handler, seastar::httpd::directory_handler, seastar::httpd::api_registry_20, and seastar::httpd::api_registry.

◆ mandatory()

handler_base& seastar::httpd::handler_base::mandatory ( const sstring &  param)
inline

Add a mandatory parameter

Parameters
parama parameter name
Returns
a reference to the handler

The documentation for this class was generated from the following file: