Supported HTTP Methods
The most commonly used HTTP methods
(or verbs) are GET
, POST
, PATCH
, and DELETE
. The building blocks of
REST APIs, these methods define actions applied to REST resources
using their URLs.
Note:
Child resources usually inherit security privileges from their parent resource. Therefore, to use a method on a child resource, you need to have access to use that method on the parent resource. However, there maybe some child resources with different privilege requirements to access them.The following table lists the methods and their scope for singular and collection resources.
Method | Works with a Singular Resource? | Works with a Collection Resource? |
---|---|---|
GET |
Yes. Gets a single resource. | Yes. Gets a subset, or all of the resources in the collection. |
POST |
Yes. Creates a single resource. | Yes. Creates a new resource in the collection. |
PUT |
Yes. Updates a resource. | No. |
PATCH |
Yes. Replaces objects related to a resource. | No. |
DELETE |
Yes. Deletes a resource. | No. |
OPTIONS |
Yes. Gets the supported methods for a resource. | No. |
The GET Method
- A collection of resources or a resource:
application/json
application/xml
- The catalog information of a resource:
application/json
- The catalog schema information of
a resource:
application/schema+json
The POST Method
Use to create
a new resource. The media types allowed with this method are application/json
and application/xml.
The PUT Method
Use to update
a resource. The media types allowed with this method are application/json
and application/xml.
The PATCH Method
Use to replace
the objects related to a resource. The media types allowed with this
method are application/json
and application/xml.
The DELETE Method
Use to delete a resource. This request method does not require a request body.
The OPTIONS Method
Use to find
the HTTP methods available for a resource. The only media type allowed
with this method is application/json
. This request method does not require a request body.