HTTP request Methods

Joel O.Joel O.
2 min read

As a beginner many years ago, I kept seeing these words:

  • GET
  • POST
  • PUT
  • PATCH
  • DELETE

But what do these HTTP request types mean? Let's explain this with a simple analogy.

Let's say you own an Italian restaurant. Flag of Italy

You have a staff that consists of kitchen personnel and waiters. Customers can come in to sit down and order some of your delicious food!

Making orders can be done by choosing from the menu card.

GET

You walk into the restaurant and sit down. Let's eat! Fork and knife with plate

You call the waiter and ask him to bring the menu for you. He brings you the menu and you have the proper information that you needed to order your food!

GET is used to request data from a specified resource

POST

An employee comes up with an awesome new recipe. The owner of the restaurant likes it and says:

Alright, let's add this to our menu, so our customers can now order this new recipe!

POST is (mostly) used to send data to a server and store it.

PATCH

A customer notices a grammar mistake on the menu and notifies the waiter.

The budget is currently tight and there is no money to replace all the menu cards, so they use correction tape to fix the typo.

PATCH supplies a set of instructions to modify a resource.

PUT

Three months later, a customer finds another typo on the menu. This has gotten out of hand. Time to change the whole menu.

New menu cards are ordered and replace the old ones, fixing all the typos.

PUT supplies a modified version of a resource and replaces the original.

DELETE

The owner of the restaurant decides that his physical business isn't viable anymore and moves to order only.

The menu cards are not needed anymore so he throws them away.

DELETE is for deleting a resource.

A wonderful piece by Raf Rasenberg.

10
Subscribe to my newsletter

Read articles from Joel O. directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Joel O.
Joel O.

A passionate cybersecurity enthusiast and cloud aficionado. I am on a mission to unravel the complexities of the ever-evolving cyber landscape and guide you through the vast expanse of cloud technology. As a cybersecurity professional, I bring a wealth of experience in securing digital ecosystems and defending against cyber threats. My journey in the cloud realm has been both thrilling and enlightening, and I am here to share my insights, discoveries, and practical tips with you. In these virtual pages, expect a fusion of in-depth cybersecurity analyses and explorations into the limitless possibilities of cloud computing and cybersecurity. Whether you're a seasoned cybersecurity professional, a cloud enthusiast, or someone just stepping into the digital frontier, there's something here for you.