acl/app/wizard/tmpl/http/http_servlet.h

60 lines
1.3 KiB
C
Raw Normal View History

#pragma once
2014-11-19 00:25:21 +08:00
2020-08-21 14:51:09 +08:00
class http_service;
2014-11-19 00:25:21 +08:00
class http_servlet : public acl::HttpServlet
{
public:
2020-08-21 14:51:09 +08:00
http_servlet(http_service& service, acl::socket_stream* conn,
acl::session* session);
~http_servlet(void);
2014-11-19 00:25:21 +08:00
protected:
// @override
2020-08-21 14:51:09 +08:00
bool doGet(HttpRequest& req, HttpResponse& res);
// @override
bool doPost(HttpRequest& req, HttpResponse& res);
// @override
bool doHead(HttpRequest& req, HttpResponse& res);
// @override
bool doPut(HttpRequest& req, HttpResponse& res);
// @override
bool doPatch(HttpRequest& req, HttpResponse& res);
// @override
bool doConnect(HttpRequest& req, HttpResponse& res);
// @override
2020-08-21 14:51:09 +08:00
bool doPurge(HttpRequest& req, HttpResponse& res);
// @override
2020-08-21 14:51:09 +08:00
bool doDelete(HttpRequest& req, HttpResponse& res);
// @override
2020-08-21 14:51:09 +08:00
bool doOptions(HttpRequest& req, HttpResponse& res);
// @override
bool doProfind(HttpRequest& req, HttpResponse& res);
// @override
bool doWebsocket(HttpRequest& req, HttpResponse& res);
// @override
bool doUnknown(HttpRequest& req, HttpResponse& res);
// @override
bool doError(HttpRequest& req, HttpResponse& res);
// @override
bool doOther(HttpRequest&, HttpResponse& res, const char* method);
private:
2020-08-21 14:51:09 +08:00
http_service& service_;
bool doService(int type, HttpRequest& req, HttpResponse& res);
2014-11-19 00:25:21 +08:00
};