NestJS · Junior · Question 75 of 75

Why prefer @Body(), @Param() and @Query() over @Req() in handlers?

Explanation

With @Req() you depend on the platform's request object and lose automatic validation of each value.

Further reading

Problem with a question

NestJS · Junior · question 75

Test yourself

Take the NestJS · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz