GET /products/12GET /products/12 is correct. In REST, the URL names a resource with a plural noun and an ID. The HTTP method says the action.
Why the others are wrong:
• GET /getProduct?id=12 and GET /product/fetch/12 put verbs like get or fetch in the path. This repeats what the method already says.
• POST /products/get/12 uses POST for a read. POST is not safe (it may change data) and is not cached, so you lose both benefits of GET.
Read more
- REST (MDN) (https://developer.mozilla.org/en-US/docs/Glossary/REST)developer.mozilla.org