headers:{

host: 'localhost:3000',
  connection: 'close',
  'user-agent': 'Paw/3.1.8 (Macintosh; OS X/10.14.5) GCDHTTPRequest'
}
This commit is contained in:
Jeremy Yin 2019-06-17 23:01:59 +08:00
parent 9479429b8c
commit 245af79f31
1 changed files with 3 additions and 2 deletions

View File

@ -1,9 +1,10 @@
import { Controller, Get, Req, Query } from '@nestjs/common'; import { Controller, Get, Req, Query, Headers } from '@nestjs/common';
@Controller('posts') @Controller('posts')
export class PostsController { export class PostsController {
@Get() @Get()
index(@Query() query) { index(@Headers() headers, @Query() query) {
console.log(headers)
console.log(query) console.log(query)
return [ return [
{ {