5 common HTTP methods that any web developer must be familiar with.

5 common HTTP methods that any web developer must be familiar with.

The Hypertext Transfer Protocol (HTTP) defines methods used to enable communications between a client and a server. It determines the instructions needed to make request-response between a client and server.

Example: When you visit a website, your browser (client) requests resources from a server by making an HTTP request to the server; the server then returns a response to your browser (client). The server response contains status information about the request your browser made, and may also contain the content your browser requested, in this case the website you want to visit.

HTTP methods are the verbs that can be used to access data over HTTP. There are eight HTTP methods defined in the protocol, though not all of them may be used for a given request. In this post i will be mention the most common methods.

GET:

GET is the most common HTTP method. It is used to request or retrieve data from a specified resource.

POST:

POST is used to create or change data on a server with information supplied in the request body (e.g., form input).

PUT:

When you want to update or create data on a server, PUT is used. Unlike PATCH, PUT will overwrite any existing data at the location specified by the pathname. PUT should only be used if you want to completely replace resource.

PATCH:

PATCH is used to modify a resource. Its differs from PUT, which is used to completely replace data.

DELETE:

DELETE is obviously the method for deleting a resource.

I hope you found the article insightful and informative. Please like/share so that it reaches others as well. Let's connect. I share my web development journey and insights in programming as well.