Reputation: 5386
I have knowledge of get and post routes but I want to learn how to use these routes (put, patch and delete) and what are their pros and cons. Till now I have used get and post to get, update or delete the record. I think it is not correct way to do it. Definitely they also have a purpose. If anyone can explain then please do it. Thanks.
Upvotes: 1
Views: 909
Reputation: 1707
The best way to explain is show how REST API works. Just imagine a book.
PATCH /book - modify book
GET /books - get list of books
Different method for different actions and no needs of naming it like: '/getBook', '/deleteBook' and etc
Upvotes: 2