Skip to content

Commit 9ffc122

Browse files
committed
fix: update echo server to return request body correctly
1 parent 0088558 commit 9ffc122

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

examples/responder/main.mbt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ async fn main {
4040
})
4141

4242
// Echo Server
43-
..post("/echo", e => e.req)
43+
..post("/echo", e => {
44+
let body : Bytes = e.req.body()
45+
body
46+
})
4447

4548
// 404 Page
4649
.get("/404", _ => {

examples/route/main.mbt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ async fn main {
5858
})
5959

6060
// Echo Server
61-
..post("/echo", e => e.req)
61+
..post("/echo", e => {
62+
let body : Bytes = e.req.body()
63+
body
64+
})
6265

6366
// 404 Page
6467
.use_middleware(not_found_middleware())

0 commit comments

Comments
 (0)