From aea88561486cbc71a1b7e0b69316ad72ef68bd72 Mon Sep 17 00:00:00 2001 From: Jeremy Yin Date: Mon, 17 Jun 2019 23:19:36 +0800 Subject: [PATCH] =?UTF-8?q?post=E8=AF=B7=E6=B1=82=EF=BC=8C=E5=8F=91body=20?= =?UTF-8?q?json=E6=A0=BC=E5=BC=8F=E6=95=B0=E6=8D=AE=EF=BC=8C=E9=80=9A?= =?UTF-8?q?=E8=BF=87body=E6=8B=BF=E5=88=B0=E6=95=B0=E6=8D=AE=EF=BC=8C?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E5=93=8D=E5=BA=94=E6=98=AF201=EF=BC=8C?= =?UTF-8?q?=E8=B7=9Ftornado=E5=85=A8=E9=83=A8200=E6=9C=89=E4=BA=9B?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E6=A0=B7=EF=BC=8C=E6=9B=B4=E6=8E=A5=E8=BF=91?= =?UTF-8?q?restful=E6=A0=87=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/posts/posts.controller.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/posts/posts.controller.ts b/src/posts/posts.controller.ts index 4a7a5af..3576975 100644 --- a/src/posts/posts.controller.ts +++ b/src/posts/posts.controller.ts @@ -1,4 +1,4 @@ -import { Controller, Get, Req, Query, Headers, Param } from '@nestjs/common'; +import { Controller, Get, Post, Req, Query, Headers, Param, Body } from '@nestjs/common'; @Controller('posts') export class PostsController { @@ -19,4 +19,10 @@ export class PostsController { title: `Post ${params.id}` } } + + @Post() + store(@Body() body) { + console.log(body) + return body + } }