Skip to content

Instantly share code, notes, and snippets.

@zakjan
Last active August 29, 2015 14:28
Show Gist options
  • Save zakjan/0f10cb352c4d141a0c64 to your computer and use it in GitHub Desktop.
Save zakjan/0f10cb352c4d141a0c64 to your computer and use it in GitHub Desktop.

HTTP methods

HTTP methods indicate the desired action to be performed on the identified resource.

Method Idempotent Safe Body
GET yes yes no
SEARCH (proposed) yes yes yes
POST no no yes
PUT yes no yes
PATCH no no yes
DELETE yes no no
  • Idempotent - request has no additional effect, if it is called more than once
  • Safe - request doesn't change server state
  • Body - request can contain body, that can affect response

Safe methods can be cached by intermediates.

Other methods

  • OPTIONS requests available HTTP methods on the requested resource
  • HEAD requests resource headers (= GET without response body)
  • TRACE requests to echo the received request

If a method is unknown to an intermediate, it will be treated as an unsafe and non-idempotent method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment