Fundamentally, yes, methods are there to allow different "interactions" with every "entity". HTTP is designed so you can think of each URL as one entity.
/users
represents all users
/users/dave
represents one specific user
POST /users
lets you create a new user
PUT /users/dave
lets you modify a specific user
GET /users
gets you a list of users
GET /users?name=dave
lets you query for a list of users named "dave"
and so on...
That's the way HTTP was designed to be used, each verb has a specific implied meaning. You can use those verbs any way you want really, but GET
implies "passive" information retrieval, while POST
, PUT
and DELETE
imply destructive changes.
Browsers and other clients do handle these differently. It's expected that anything GET
can be requested at any time any number of times, can be cached, can be pre-fetched, can be queried mostly out of order. More destructive actions should be performed only once when requested and not cached, pre-fetched or anything else. A browser will explicitly ask for confirmation if you're "reloading" a page requested via POST
.
POST form sends data "in the background", while GET passes them in the URL. Does it have anything to do with the protocol or is it just browsers' convention?
"In the background" is the wrong way of thinking. The difference is between the URL and the request body. A GET
request should not/must not have anything in its request body. Again, it's only passive information retrieval and must solely consist of HTTP headers. A POST
request can have a request body. A request can have "data" both in its URL and in its body. Again, an assumption is that GET
URLs can be shared and passed around, since it just links to information. POST
requests on the other hand need to be very deliberate, so its information should not and doesn't need to be in the URL.