![]() |
zeep::http::controller — A base class for controllers, classes that handle a request.
// In header: <zeep/http/controller.hpp> class controller { public: // construct/copy/destruct (); (controller &) = ; controller & (controller &) = ; ~(); // public member functions (, request &, reply &); (request &, reply &) = ; () ; () ; (request &) ; (basic_server *); basic_server & () ; basic_server & (); json::element () ; () ; () ; () ; };
This concept is inspired by the Spring way of delegating the work to controller classes. In libzeep there are two major implementations of controllers: zeep::http::rest_controller and zeep::http::soap_controller
There can be multiple controllers in a web application, each is connected to a certain prefix-path. This is the leading part of the request URI.
controller
public
construct/copy/destruct( prefix_path);constructor
Parameters: |
|
(controller &) = ;
controller & (controller &) = ;
~();
controller
public member functions( socket, request & req, reply & rep);Calls handle_request but stores a pointer to the request first.
(request & req, reply & rep) = ;The pure virtual method that actually handles the request.
() ;returns the defined prefix path
( path) ;return whether this uri request path matches our prefix
(request & req) ;return the path with the prefix path stripped off
(basic_server * server);bind this controller to server
basic_server & () ;return the server object we're bound to
basic_server & ();
json::element () ;get the credentials for the current request
() ;get the remote client address for the current request
( role) ;returns whether the current user has role role
( name) ;return a specific header line from the original request