|
| 1 | +# HttpServer |
| 2 | +Http's server. |
| 3 | +<br></br> |
| 4 | +```C++ |
| 5 | +HttpServer(EventLoop* loop) |
| 6 | +``` |
| 7 | +Constructor. |
| 8 | +* EventLoop* loop : Event loop句柄。 |
| 9 | +<br></br> |
| 10 | +```C++ |
| 11 | +void Get(std::string path, OnHttpReqCallback callback) |
| 12 | +``` |
| 13 | +Set `GET` methon callback. |
| 14 | +* std::string path : Routing path,wildcards allowed. |
| 15 | +* OnHttpReqCallback callback : Callback function. |
| 16 | +<br></br> |
| 17 | +```C++ |
| 18 | +void Post(std::string path, OnHttpReqCallback callback) |
| 19 | +``` |
| 20 | +Set `POST` methon callback. |
| 21 | +* std::string path : Routing path,wildcards allowed. |
| 22 | +* OnHttpReqCallback callback : Callback function. |
| 23 | +<br></br> |
| 24 | +```C++ |
| 25 | +void Head(std::string path, OnHttpReqCallback callback) |
| 26 | +``` |
| 27 | +Set `HEAD` methon callback. |
| 28 | +* std::string path : Routing path,wildcards allowed. |
| 29 | +* OnHttpReqCallback callback : Callback function. |
| 30 | +<br></br> |
| 31 | +```C++ |
| 32 | +void Put(std::string path, OnHttpReqCallback callback) |
| 33 | +``` |
| 34 | +Set `PUT` methon callback. |
| 35 | +* std::string path : Routing path,wildcards allowed. |
| 36 | +* OnHttpReqCallback callback : Callback function. |
| 37 | +<br></br> |
| 38 | +```C++ |
| 39 | +void Delete(std::string path, OnHttpReqCallback callback) |
| 40 | +``` |
| 41 | +Set `DELETE` methon callback. |
| 42 | +* std::string path : Routing path,wildcards allowed. |
| 43 | +* OnHttpReqCallback callback : Callback function. |
| 44 | +<br></br> |
| 45 | +```C++ |
| 46 | +void Connect(std::string path, OnHttpReqCallback callback) |
| 47 | +``` |
| 48 | +Set `CONNECT` methon callback. |
| 49 | +* std::string path : Routing path,wildcards allowed. |
| 50 | +* OnHttpReqCallback callback : Callback function. |
| 51 | +<br></br> |
| 52 | +```C++ |
| 53 | +void Options(std::string path, OnHttpReqCallback callback) |
| 54 | +``` |
| 55 | +Set `OPTIONS` methon callback. |
| 56 | +* std::string path : Routing path,wildcards allowed. |
| 57 | +* OnHttpReqCallback callback : Callback function. |
| 58 | +<br></br> |
| 59 | +```C++ |
| 60 | +void Trace(std::string path, OnHttpReqCallback callback) |
| 61 | +``` |
| 62 | +Set `TRACE` methon callback. |
| 63 | +* std::string path : Routing path,wildcards allowed. |
| 64 | +* OnHttpReqCallback callback : Callback function. |
| 65 | +<br></br> |
| 66 | +```C++ |
| 67 | +void Patch(std::string path, OnHttpReqCallback callback) |
| 68 | +``` |
| 69 | +Set `PATCH` methon callback. |
| 70 | +* std::string path : Routing path,wildcards allowed. |
| 71 | +* OnHttpReqCallback callback : Callback function. |
0 commit comments