From 245af79f310dd26dc8755efd8b284758789fbfcd Mon Sep 17 00:00:00 2001 From: Jeremy Yin Date: Mon, 17 Jun 2019 23:01:59 +0800 Subject: [PATCH] =?UTF-8?q?headers=EF=BC=9A{=20=20=20host:=20'localhost:30?= =?UTF-8?q?00',=20=20=20connection:=20'close',=20=20=20'user-agent':=20'Pa?= =?UTF-8?q?w/3.1.8=20(Macintosh;=20OS=20X/10.14.5)=20GCDHTTPRequest'=20}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/posts/posts.controller.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/posts/posts.controller.ts b/src/posts/posts.controller.ts index 108a9b3..beb6a49 100644 --- a/src/posts/posts.controller.ts +++ b/src/posts/posts.controller.ts @@ -1,9 +1,10 @@ -import { Controller, Get, Req, Query } from '@nestjs/common'; +import { Controller, Get, Req, Query, Headers } from '@nestjs/common'; @Controller('posts') export class PostsController { @Get() - index(@Query() query) { + index(@Headers() headers, @Query() query) { + console.log(headers) console.log(query) return [ {