NestJS · Junior · Question 17 of 75

How do you read the JSON body of a POST request in a controller?

Explanation

@Body() dto: CreateUserDto. @Query() reads query strings, @Param() route params, @Headers() headers.

Further reading

Problem with a question

NestJS · Junior · question 17

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