HTTP Methods Flashcards
CRUD, the Create equivalent is…
POST
Usually 201, 404, 409…
CRUD the Read equivalent is…
GET (name: value in URL) UNSECURE
POST (name: value NOT in URL)
Usually 200, 404…
CRUD the Update “replace” equivalent is…
PUT
Usually 405, 200, 204, 404…
CRUD the Update “modify” equivalent is…
PATCH
Usually 200, 204, 404, 405…
CRUD the Destroy equivalent is…
DELETE
Usually 200, 404, 405…
The GET Method
GET requests... can be cached remain in the browser can be bookmarked IS UNSAFE and should not be used for sensitive data Only used for requesting data GET requests have length restrictions
The POST Method
POST is... Never cached Never in browser history Cannot be bookmarked Have no restrictions on data length
The PUT Method
PUT sends data to create/update a resource
PUT requests are idempotent ‘unchanging’ unlike POST. A POST request will create a resource multiple time while PUT will not.
The HEAD Method
Checks that a READ request will work without sending a response.
Good to use before returning a large response.
The DELETE Method
Deletes a resource
The PATCH Method
Patch is used to partially UPDATE a resource
The OPTIONS Method
Describes the communication options for the target source
The CONNECT Method
Starts two-way communication with
the requested resource (a tunnel)
The TRACE Method
Performs a message loop-back test
to test the path for the target resource
(useful for debugging)