BREAKING CHANGE(request): introduce lazy request body parsing via ctx.json()/text()/arrayBuffer()/formData and remove IRequestContext.body
This commit is contained in:
@@ -69,8 +69,9 @@ class TestController {
|
||||
}
|
||||
|
||||
@Post('/echo')
|
||||
echo(ctx: IRequestContext<{ text: string }>) {
|
||||
return { echo: ctx.body?.text };
|
||||
async echo(ctx: IRequestContext<{ text: string }>) {
|
||||
const body = await ctx.json();
|
||||
return { echo: body?.text };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user