|
|
@@ -59,10 +59,8 @@ public:
|
|
|
});
|
|
|
|
|
|
// curl -v http://ip:port/echo -d "hello,world!"
|
|
|
- router.POST("/echo", [](HttpRequest* req, HttpResponse* resp) {
|
|
|
- resp->content_type = req->content_type;
|
|
|
- resp->body = req->body;
|
|
|
- return 200;
|
|
|
+ router.POST("/echo", [](const HttpContextPtr& ctx) {
|
|
|
+ return ctx->send(ctx->body(), ctx->type());
|
|
|
});
|
|
|
|
|
|
// wildcard *
|