#When should I specify data as a URL Query param or in the Body

4 messages · Page 1 of 1 (latest)

next wraith
#

Im trying to follow REST principles, but Its a bit gray to me atm.

NESTjs gives me the ability to add @Query, @Param, @Body as decorators to specify data coming from different places in the request.

What is the standard that I should be following?

urban bison
next wraith
#

yah I understand that part, but in terms of best convention, when should I use each and why

urban bison
#

the @Param decorator is used when you need to pass parameters, for example you need to find a user's ID, using a Get