Methods of HTTP
- GET: Used to retrieve data from a specified resource. It should have no side effects and is commonly used for fetching web pages, images, etc.
- POST: Used to submit data to be processed by a specified resource. It is suitable for form submissions, file uploads, and creating new resources.
- PUT: Used to update or create a resource on the server. It replaces the entire resource with the data provided in the request body.
- PATCH: Similar to PUT but used for partial modifications to a resource. It updates specific fields of a resource rather than replacing the entire resource.
- DELETE: Used to remove a specified resource from the server.
- HEAD: Similar to GET but retrieves only the response headers, useful for checking resource properties without transferring the full content.
- OPTIONS: Used to retrieve the communication options available for a resource, including supported methods and headers.
- TRACE: Used for debugging purposes to echo the received request back to the client, though it’s rarely used due to security concerns.
- CONNECT: Used to establish a tunnel to the server through an HTTP proxy, commonly used for SSL/TLS connections.
What is HTTP ?
HTTP (Hypertext Transfer Protocol) is a fundamental protocol of the Internet, enabling the transfer of data between a client and a server. It is the foundation of data communication for the World Wide Web.
HTTP provides a standard between a web browser and a web server to establish communication. It is a set of rules for transferring data from one computer to another. Data such as text, images, and other multimedia files are shared on the World Wide Web. Whenever a web user opens their web browser, the user indirectly uses HTTP. It is an application protocol that is used for distributed, collaborative, hypermedia information systems.