Methods
The HTTP verbs comprise our “uniform interface” and provide us with the action counterpart to noun-based resources. The most-commonly-used verbs (or methods) are POST, GET, PUT, PATCH, and DELETE. These correspond to create, read, update, and delete (or CRUD) operations, respectively.
HEAD
HEAD
The HEAD
method is used to request HTTP headers from the server. The HEAD
request is identical to the GET
request except that the server must not return the message body in the response. Requests using the HEAD
method will only retrieve data and are considered safe.
Since BankTech uses a bearer token authentication scheme, your header request will always include:
GET
GET
The GET
verb is used to retrieve a representation of a resource. According to the design of the HTTP specification, GET
(along with HEAD
) requests are used only to read data and not change it. Requests using the GET
method will only retrieve data and are considered safe.
POST
POST
The POST
verb is most often utilized to create new resources. In particular, it's used to create subordinate resources. That is, subordinate to some other (e.g. parent) resource. Making two identical POST
requests will most likely result in two resources containing the same information.
PUT
PUT
The PUT
verb is most-often utilized for update capabilities, PUT-ing to a known resource with the request body containing the newly-updated version of the original resource. However, PUT
can also be used to create a resource in the case where the resource ID is chosen by the client instead of by the server.
PATCH
PATCH
The PATCH
verb is used for modify capabilities. The PATCH
request only needs to contain the changes to the resource, not the complete resource. This resembles PUT
, but the body contains a set of instructions describing how a resource on the server should be modified to produce a new version.
DELETE
DELETE
The DELETE
verb is pretty easy to understand. It is used to delete a resource identified. HTTP-spec-wise, DELETE
operations are idempotent. If you DELETE
a resource, it is removed. Repeatedly calling DELETE
on that resource ends up with the same result: the resource is already gone.
Last updated
Was this helpful?