Additional HTTP Methods that you haven’t heard of!
Are there any other http methods other than GET, POST, PUT, DELETE?
The answer is, yes, there are several other HTTP methods in addition to GET, POST, PUT, and DELETE.
These methods are part of the HTTP standard and serve various purposes in web communication.
Below lists some commonly used HTTP methods
HEAD
This method is similar to GET, but it only requests the headers of the resource without the actual body content. It’s often used to check if a resource exists or to retrieve metadata.
HEAD /example HTTP/1.1
Host: www.example.com
OPTIONS
The OPTIONS method is used to request information about the communication options available for the target resource, such as which methods are supported or what type of authentication is required.
OPTIONS /users/123 HTTP/1.1
Host: api.example.com
PATCH
The PATCH method is used to apply partial modifications to a resource. It’s often used to update specific fields of a resource without sending the entire resource.
PATCH /users/123 HTTP/1.1
Content-Type: application/json
{
"email": "new.email@example.com"
}
CONNECT
This method is used to establish a network connection to a resource, usually for the purpose of setting up a secure tunnel (HTTPS).
CONNECT www.example.com:443 HTTP/1.1
Host: www.example.com
TRACE
The TRACE method is used to retrieve a diagnostic trace of the actions performed by the server for the received request. It’s often used for debugging and troubleshooting.
TRACE /path/resource HTTP/1.1
Host: www.example.com
PROPFIND
This method is used to retrieve properties (metadata) about a resource. It’s commonly used in WebDAV protocols for accessing and managing remote resources.
PROPFIND /documents/doc1 HTTP/1.1
Host: www.example.com
PROPPATCH
Similar to PROPFIND, the PROPPATCH method is used to set or update properties of a resource in WebDAV scenarios, i.e. The PROPPATCH method is used to modify properties of a web resource, stored as XML.
PROPPATCH /documents/doc1 HTTP/1.1
Host: www.example.com
Content-Type: application/xml
<?xml version="1.0"?>
<propertyupdate xmlns="DAV:">
<set>
<prop>
<author>John Doe</author>
</prop>
</set>
</propertyupdate>
These methods are defined by the HTTP standard and can be used to perform various actions on resources. However, not all of them are supported by all servers or are commonly used in every web application. The most commonly used methods are GET, POST, PUT, and DELETE, with HEAD, OPTIONS, and PATCH also being used in certain scenarios.