Nest: Why is it so difficult to get a simple step to get the header values of an API request for nestjs fastify/express?

Created on 27 Oct 2020  路  2Comments  路  Source: nestjs/nest

can someone please give the straight forward way to get request values(headers/params) in the controller API. Also can we specify this in the DTO for the API request. Didn't find it in the documentation either (found it for express specific for the request but not for fastify- this was for access and not for the DTO)

needs triage question 馃檶

All 2 comments

@cyb3rs4pi3n Did you check the documentation here?

@cyb3rs4pi3n I'm not sure what you're having problems with, but @Headers(), @Param(), @Query(), and all the other decorators work for both Express and Fastify without any extra configuration necessary. You could theoretically do it in the DTO, but you then need a custom decorator which could be more annoying than expected.

If you have more questions about general use of the framework, please use our Discord as we're using GitHub to track Feature Requests, Bug Reports, and Regressions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rlesniak picture rlesniak  路  3Comments

marshall007 picture marshall007  路  3Comments

tronginc picture tronginc  路  3Comments

yanshuf0 picture yanshuf0  路  3Comments

artaommahe picture artaommahe  路  3Comments