9 HTTP request methods every beginner should know as a developer

HTTP or Hypertext Transfer Protocol is an application-level protocol used to send or receive a hypermedia document such as HTML. HTTP is the foundation of the internet. When we type a website URL on a web browser HTTP is the one that connects us with the remotely located computer or server.

1. GET

A GET request retrieves data from a web server by specifying parameters in the URL portion of the request. This is the main method used for document retrieval.

2. POST

The POST method is used when you want to send some data to the server such as updating a file, submitting a form like a login, or signup.

3. PATCH

The PATCH method is used when you need a partial modification to a resource in the server. A PATCH request is considered a set of instructions on how to modify a resource

4. PUT

Replaces all current representations of the target resource with the uploaded content. The difference between PUT and POST is that PUT is idempotent: calling it once or several times successively has the same effect (that is no side effect), whereas successive identical POST requests may have additional effects, akin to placing an order several times.

5. DELETE

The DELETE method is used to request the server to delete a file at a location specified by the given URL.

6. HEAD

Same as GET, but transfers the status line and header section only.

7. CONNECT

Establishes a tunnel to the server identified by a given URI. The HTTP CONNECT method starts two-way communications with the requested resource. It can be used to open a tunnel.

8. OPTIONS

Describes the communication options for the target resource. an OPTIONS request should return data describing what other methods and operations the server supports at the given URL.

9. TRACE

The HTTP TRACE method performs a message loop-back test along the path to the target resource, providing a useful debugging mechanism.