C++ Web Framework  3.0
Public Member Functions | List of all members
Controller Class Reference

The Controller class is responsable to attend a request from a specific url. You will need to create a derived class from Controller and then, reconstruct the desired method to response a request, after this, you will need mapping the url to the new controller that you created, you need to do it into the ConfigureCppWebServer using the method addUrlController. More...

#include <controller.h>

Inheritance diagram for Controller:
Inheritance graph
[legend]

Public Member Functions

virtual ~Controller ()
 Destructor.
 
virtual void doDelete (Request &req, Response &resp) const
 This is an virtual method that can be overloaded to attend the delete request method. More...
 
virtual void doGet (Request &req, Response &resp) const
 This is an virtual method that can be overloaded to attend the get request method. More...
 
virtual void doOptions (Request &req, Response &resp) const
 This is an virtual method that can be overloaded to attend the options request method. More...
 
virtual void doPost (Request &req, Response &resp) const
 This is an virtual method that can be overloaded to attend the post request method. More...
 
virtual void doPut (Request &req, Response &resp) const
 This is an virtual method that can be overloaded to attend the put request method. More...
 
virtual void doTrace (Request &req, Response &resp) const
 This is an virtual method that can be overloaded to attend the trace request method. More...
 

Detailed Description

The Controller class is responsable to attend a request from a specific url. You will need to create a derived class from Controller and then, reconstruct the desired method to response a request, after this, you will need mapping the url to the new controller that you created, you need to do it into the ConfigureCppWebServer using the method addUrlController.

Member Function Documentation

◆ doDelete()

virtual void Controller::doDelete ( Request req,
Response resp 
) const
inlinevirtual

This is an virtual method that can be overloaded to attend the delete request method.

Parameters
req: This is a reference to the Request.
resp: This is a reference to the Response.

◆ doGet()

virtual void Controller::doGet ( Request req,
Response resp 
) const
inlinevirtual

This is an virtual method that can be overloaded to attend the get request method.

Parameters
req: This is a reference to the Request.
resp: This is a reference to the Response.

Reimplemented in CppWebController.

◆ doOptions()

virtual void Controller::doOptions ( Request req,
Response resp 
) const
inlinevirtual

This is an virtual method that can be overloaded to attend the options request method.

Parameters
req: This is a reference to the Request.
resp: This is a reference to the Response.

◆ doPost()

virtual void Controller::doPost ( Request req,
Response resp 
) const
inlinevirtual

This is an virtual method that can be overloaded to attend the post request method.

Parameters
req: This is a reference to the Request.
resp: This is a reference to the Response.

◆ doPut()

virtual void Controller::doPut ( Request req,
Response resp 
) const
inlinevirtual

This is an virtual method that can be overloaded to attend the put request method.

Parameters
req: This is a reference to the Request.
resp: This is a reference to the Response.

◆ doTrace()

virtual void Controller::doTrace ( Request req,
Response resp 
) const
inlinevirtual

This is an virtual method that can be overloaded to attend the trace request method.

Parameters
req: This is a reference to the Request.
resp: This is a reference to the Response.

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