DEV Community

Discussion on: NestJS: stop handling errors like this!

Collapse
 
antoncodes profile image
Anton Bahurinsky

You mean passing the product ID as a URL parameter? Well, the ID could indeed have been passed differently, e.g. as a query parameter or even within a body (not recommended though, especially for GET requests). That's up to developer's choice.
However, by passing the product ID as a URL parameter, we get somewhat neater final URLS, for example:
GET https://mywebapp.com/product/12345
(as opposed to:
GET https://mywebapp.com/product?id=12345)