HTTP Methods

HTTP (Hypertext Transfer Protocol) defines several methods, also known as HTTP verbs, that indicate the desired action to be performed on a given resource. Each method has a specific purpose and usage in web development. The most commonly used HTTP methods are:


1. GET: The GET method is used to retrieve a representation of a resource from a server. It is a safe and idempotent method, meaning it should not have any side effects on the server and can be repeated multiple times without changing the server state.

2. POST: The POST method is used to submit data to be processed by the server. It typically results in the creation of a new resource on the server or performs some other action based on the submitted data. It is not idempotent, meaning multiple requests may result in different outcomes.

3. PUT: The PUT method is used to update or replace an existing resource on the server with the provided data. It replaces the entire resource with the new data. It is idempotent, meaning multiple identical requests have the same effect as a single request.

4. PATCH: The PATCH method is used to partially update an existing resource on the server with the provided data. Unlike PUT, which replaces the entire resource, PATCH only updates the specified fields or properties of the resource. It is not necessarily idempotent.

5. DELETE: The DELETE method is used to request the removal of a specified resource from the server. It deletes the resource identified by the URL. It is idempotent, meaning multiple identical requests have the same effect as a single request.

6. HEAD: The HEAD method is similar to the GET method but retrieves only the headers of a resource, without the actual content. It is commonly used to retrieve metadata about a resource, such as its size or last modification date.

7. OPTIONS: The OPTIONS method is used to request information about the communication options available for a resource or the server itself. It is often used to check the allowed methods or headers for a resource.


These HTTP methods are used in combination with URLs and headers to perform different actions on web resources. The appropriate method to use depends on the desired operation and the specific requirements of the application or API being developed.



About the Author



Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc





 PreviousNext