mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-15 17:30:53 +08:00
33 lines
887 B
C
33 lines
887 B
C
|
#pragma once
|
||
|
|
||
|
class http_servlet : public acl::HttpServlet
|
||
|
{
|
||
|
public:
|
||
|
http_servlet(acl::socket_stream*, acl::session*, const char*);
|
||
|
~http_servlet();
|
||
|
|
||
|
protected:
|
||
|
// @override
|
||
|
bool doError(acl::HttpServletRequest&, acl::HttpServletResponse&);
|
||
|
|
||
|
// @override
|
||
|
bool doOther(acl::HttpServletRequest&,
|
||
|
acl::HttpServletResponse&, const char* method);
|
||
|
|
||
|
// @override
|
||
|
bool doGet(acl::HttpServletRequest&, acl::HttpServletResponse&);
|
||
|
|
||
|
// @override
|
||
|
bool doPost(acl::HttpServletRequest&, acl::HttpServletResponse&);
|
||
|
|
||
|
private:
|
||
|
acl::string addr_;
|
||
|
|
||
|
bool replyf(acl::HttpServletRequest&,
|
||
|
acl::HttpServletResponse&, int status, const char* fmt, ...);
|
||
|
bool reply(acl::HttpServletRequest&,
|
||
|
acl::HttpServletResponse&, int status, const acl::string&);
|
||
|
bool reply_json(acl::HttpServletRequest&, acl::HttpServletResponse&,
|
||
|
int status, const acl::string&);
|
||
|
};
|