You are designing a RESTful API for an e-commerce platform. How would you structure the API endpoints to handle CRUD operations for products?

  • a) /api/products/create, /api/products/read, /api/products/update, /api/products/delete
  • b) /api/createProduct, /api/readProduct, /api/updateProduct, /api/deleteProduct
  • c) /api/products POST, GET, PUT, DELETE
  • d) /api/products, POST, GET, PUT, DELETE
In a RESTful API, CRUD operations are typically represented by HTTP methods. Option (c) follows REST conventions with POST, GET, PUT, and DELETE HTTP methods for creating, reading, updating, and deleting products.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *