0

From What is the difference between HTTP and REST? , the most voted/acceptable answer depicts the difference as

No, REST is the way HTTP should be used

Today we only use a tiny bit of the HTTP protocol's methods – namely GET and POST. The REST way to do it is to use all of the protocol's methods.

For example, REST dictates the usage of DELETE to erase a document (be it a file, state, etc.) behind a URI, whereas, with HTTP, you would misuse a GET or POST query like ...product/?delete_id=22.

What I get from above is HTTP provides us following verbs POST, GET, PUT, and DELETE but still developers misuse the POST( or GET) to delete or update the resource on web.

My questions :-

  1. Does REST makes it mandatory that only DELETE method is used to delete the resource not through POST(similarly for PUT/update) ? I believe NO. If yes how ?

  2. What is the advantage of using all verbs than doing it just through GET and POST ?

Basically I have come from web development background using mainly two HTTP methods i.e. GET and POST. Now when I look at any REST API's I do not find any things different from development perspective except using extra verbs PUT and DELETE.

My point - Is there anything else different in REST from HTTP apart from these verbs ? Also what if I continue to use POST in place of PUT/DELETE even in REST services(I won't do it but asking for sake of clarity) ?

emilly
  • 10,060
  • 33
  • 97
  • 172
  • "Does REST makes it mandatory that ..." - Since is REST are only (in effect) guidelines, nothing is **mandatory**. You either follow the guidelines, or you don't. Then other people can argue about whether your API is *really* REST-ful or not. (It is "a matter of opinion" ... this is not a suitable for discussion that kind of thing.) – Stephen C Aug 06 '17 at 01:40
  • @EJP I myself pointed in mine post that I have gone through https://stackoverflow.com/questions/2190836/what-is-the-difference-between-http-and-rest and I have specific questions on the accepted answer. To get those questions answered, is the intention of this question. Regarding the most voted answer on https://stackoverflow.com/questions/2191049/what-is-the-advantage-of-using-rest-instead-of-non-rest-http, I am not sure that is still valid. See mine latest comment – emilly Aug 06 '17 at 08:15

0 Answers0