DEV Community

Discussion on: Journey of a web page 🛣️ - How browsers work

Collapse
 
wpq profile image
Wpq • Edited

GET is just a method. How it is implemented on the server is up to the server.

You could run all your API on GET and act upon either the URL components or the body of the GET (there should be none, but you can use one).

GET /list → lists your objects
GET /name/add/john → adds the name "john"
GET /name/delete/john → deletes "john"

Sure, the nice way is to use PUT, DELETE etc. but the above can work perfectly. This is actually used by some APIs.

Of course, according to the specification, GET is expected to be idempotent but, again, this is just an expectation, the server can do whatever pleases it.

Thread Thread
 
gitpaulo profile image
Paulo Santos • Edited

Right, I misunderstood you, thanks for clarifying your point!
The article assumes a correct implementation of GET which follows from the specification. I will add an edit to state that explicitly.