Nest: How to get all params in request url

Created on 10 Jun 2018  路  3Comments  路  Source: nestjs/nest

I'm submitting a...


[ ] Regression 
[ ] Bug report
[ ] Feature request
[ x ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

I have this request url /book?author=admin&year=2018&format=json&category=develop
how I can get all params using @Get('book')

Most helpful comment

If you use the @Query decorator you have access to the query parameters as indicate here https://docs.nestjs.com/controllers

All 3 comments

If you use the @Query decorator you have access to the query parameters as indicate here https://docs.nestjs.com/controllers

@adrien2p thx for that link

btw there in that "Full resource sample" missing import that decorator "Query"
import { Controller, Get, Post, Body, Put, Param, Delete, Query } from '@nestjs/common';
https://docs.nestjs.com/controllers

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings