-
Notifications
You must be signed in to change notification settings - Fork 0
HTTP Methods Demystified: A Guide to Understanding HTTP Request Methods
HTTP is Hypertext Transfer Protocol.
HTTP is designed to enable communication between clients and servers. HTTP works as request-response between client and server.
HTTP methods
- GET
- POST
- PUT
- HEAD
- DELETE
- PATCH
- OPTIONS
- CONNECT
- TRACE
Two most common http methods are GET and POST
Appends data to the URL in the form of name or value pair. Request data from a specified resource. A GET Request is used to request information from a resource such as a website, a server, or an API.
Web server accepts data included in the body of the message. Send data to server to create/update a resource.It Creates a new Resource on the backend (Server). We send data to the server in the request body.
Now what is the difference between GET & POST Method
Send data to server to create/ update a resource Only difference between put method is calling same PUT request multiple times will always produce the same result. But POST requests repeatedly have same resource multiple times.Using this, we can update an existing resource by sending the updated data as the content of the request body to the server.
The HEAD method is similar to the GET method. But it doesn't have any response body. Only difference between HEAD method is make the request but not return GET Method make request and return. So if it mistakenly returns the response body, it must be ignored.
The DELETE method deletes a resource. Regardless of the number of calls, it returns the same result
Similar to PUT , PATCH updates a resource, but it updates data partially and not entirely.
Describe the communication options for target resource. It used to get information about the possible communication options for the given URL or an asterisk to refer.
Used to start a two way communication with the requested resources.The Connect Method is for making end to end connections between a client and a server. It makes a two way connection like a tunnel between them.
Used to perform a message loop back test that tests the path for target resource. Useful for debugging purposes.The TRACE Method is for diagnosis purposes. It creates a loop-back test win the same request body that the client sent to the server before, and the successful response code is 200











