Let’s talk HTTP: Get, Post, Put, and Delete

Muzamil Nawaz
3 min readJul 29, 2021
Photo by Massimo Botturi on Unsplash

If you are somehow related to programmer community or a technical person there is a high chance that you would have heard the word HTTP, let’s find out more about it in a possibly simplest way. When two entities want to talk stuff, there is always a set of rules/Protocol to follow in order to communicate things smoothly. With that being said, when those two formal entities are by chance known to be Server and Client, then the those rules/protocol is called as Hyper Text Transfer Protocol also known as HTTP. In this scenario, Client could be something who has some request to make or get its data processed in some way whereas Server can be anything which operate on data, processes it and provide a response back to requesting client. Request and Response phenomenon used here can also be referenced as HTTP Request and HTTP Response.

Just like there are several ways of communication in order to convey different kind of messages, in HTTP there are different methods to make request, each for its specific use. Most common ones are Get, Post, Put, Delete and I bet after reading title you must have guessed, we are going to discuss these in our article too, Lol.

GET

Photo by 🇸🇮 Janko Ferlič on Unsplash

As a Mobile/PC user, it is more likely that you would come across a web page or any other resource where you just have concern with displaying some data which you think service provider might have for you. In these kind of situations, where mostly client (You) don’t have to provide any input, even if you do, that’s just for filtration of content you are getting, we use Get method of HTTP protocol. This process will not contain manipulation of any data. It allows us to make a request and get the response in different possible formats with a specific ‘body’ with content client asked for.

POST

Photo by Ibrahim Rifath on Unsplash

This method of HTTP is to be used for submission of new data to the Server. For example, a Contact us form on any website eventually be using Post request method for their data to be posted/sent to the website owners by the client. As the name concerns, this method can be used for only sending data but not getting any content in return other than status of request.

PUT

To make it simple, let’s take this in a way that there is data available on the Server side now what you want to do is to put your new data by replacing existing information. In this scenario, Put method of HTTP will be a better option to use. For example, in any online profile, when you change some kind of information in your profile and submit, possibility is that on back end a Put request would be used to modify/update the existing information with the changed content.

DELETE

Photo by Markus Winkler on Unsplash

This method has pretty simple usage, as name defines itself, this HTTP method can be used to delete/remove any available information regarding client on Server’s data storage. While using this method, you just have to give the indicator about what piece of data to remove and most likely, removal of data will be done by services system might be using.

Okay, so for now we discussed the theoretical explanation of 4 HTTP methods: Get, Post, Put, and Delete. In future articles, we will see how we can use them in a simple web development example. Please share your feedback or questions if you have any in comments. I will try to cover them up.

Till next time, Cheers :)

--

--

Muzamil Nawaz

A software engineer with passion of building systems and ability of fast adaptability. Starting my writing journey, while looking forward to long way :)