Class HttpSimpleControllerBase

Synopsis

#include <lib/inc/drogon/HttpSimpleController.h>

class HttpSimpleControllerBase : public virtual DrObjectBase

Description

The abstract base class for HTTP simple controllers.

Inheritance

Ancestors: DrObjectBase

Decsendents: HttpSimpleController

Methods

~HttpSimpleControllerBase
asyncHandleHttpRequestThe function is called when a HTTP request is routed to the controller.

Source

Lines 35-51 in lib/inc/drogon/HttpSimpleController.h.

class HttpSimpleControllerBase : public virtual DrObjectBase
{
  public:
    /**
     * @brief The function is called when a HTTP request is routed to the
     * controller.
     *
     * @param req The HTTP request.
     * @param callback The callback via which a response is returned.
     */
    virtual void asyncHandleHttpRequest(
        const HttpRequestPtr &req,
        std::function<void(const HttpResponsePtr &)> &&callback) = 0;
    virtual ~HttpSimpleControllerBase()
    {
    }
};





Add Discussion as Guest

Log in