HTTP Methods

Sachith Ariyathilaka
2 min readJun 24, 2023

--

The hypertext transfer protocol, or HTTP, is designed to enable communication between clients and servers. Once the client requests it using the http method, the server will respond to the client.

There are many HTTP methods available to support the client-server architecture. Let’s discuss a few of them.

01. GET: Get methods to retrieve information from the given server by using a particular URL. The simple GET method is used to get data from the server. Mainly used for database read operations from the client.

02. POST: A POST request sends the data to the server from the client. Mainly, we use this method for database save operations.

03. PUT: A PUT method is used to update existing data in the database. Once we use PUT, we have to send the whole database object with the primary key. It means the PUT method replaces the new version with the given data.

04. PATCH: The PATCH method is also very similar to the PUT method. It is also used for database data update operations. But the main difference is that PATCH does not need to update the new version. We can only update certain information. So we just need to send the updated information.

05. DELETE: The DELETE request was used to delete the selected dataset from the database. Once we apply this method, the selected data is permanently deleted.

These are the main HTTP methods we used in the client-server architecture. Also, we can find a few other methods too. Among them are HEAD, CONNECT, and OPTIONS. But we mainly use the above-mentioned methods.

--

--

Sachith Ariyathilaka
Sachith Ariyathilaka

No responses yet