Molly and Billy have a wall where they put their art. The can do several things:
They can POST a new picture on the wall.
They can PUT a new version of a picture on top of an old one, effectively replacing the original.
They can GET a photo of a picture to share with their friends.
They can remove an existing picture from the wall, i.e. they can DELETE it.
They can also PATCH an existing picture by changing just a part of the picture.
The core idea behind RESTful web services is that we can use these basic verbs (mostly GET, DELETE, POST, and PUT) to build simple and straightforward APIs.
REST was originally designed for documents rather than sophisticated applications, so it's not always easy to fit real-world application requirements cleanly into a RESTful model (consider an API endpoint that is a single action from the point of view of a user, but behind the scenes it involves creating, updating, deleting, and retrieving things). Recently GraphQL has also been gaining momentum in the web api space.
Top comments (1)
Molly and Billy have a wall where they put their art. The can do several things:
POST
a new picture on the wall.PUT
a new version of a picture on top of an old one, effectively replacing the original.GET
a photo of a picture to share with their friends.DELETE
it.PATCH
an existing picture by changing just a part of the picture.The core idea behind RESTful web services is that we can use these basic verbs (mostly
GET
,DELETE
,POST
, andPUT
) to build simple and straightforward APIs.Also, see earlier discussion at dev.to/pratikaambani/explain-http-...