HTTP Methods: A Comprehensive Overview of Request Methods and Their Significance
HTTP supports various methods to access a resource. In the HTTP protocol, numerous request methods allow the browser to send information, forms, or files to the server.
These methods are used, among other things, to inform the server how to process a request that we send and how to respond to it.
With cURL, if we use the -v
flag to view the complete request, the first line contains the HTTP method (GET / HTTP/1.1) while in the browser (dev tools), the HTTP method is shown in the Method
tab.
In addition, response headers also have the HTTP response code, which shows the status of the processed HTTP request.
Request methods
Here are some common methods.
The list highlights some of the most common methods. The availability of a particular method depends heavily on the server and application configuration.
In this Mozilla MDN list, we can see the complete HTTP methods.
HTTP request methods — HTTP | MDN
Note: Most modern web applications rely on GET and POST methods. However, any application that uses a REST API also relies on the PUT and DELETE methods, which are used to update and delete data at the API endpoint.
Response codes
HTTP status codes are used to inform the client of the status of the request. An HTTP server can return 5 types of response codes.
Here we see the most common ones:
You can find the complete list of status codes here:
HTTP response status codes — HTTP | MDN
In addition to the standard codes, various servers and providers such as Cloudflare and AWS implement their response codes.
Thank you for reading my content.
Check out my other works: bento.me