A minimal get request from this page
GET https://datacadamia.com/web/http/method HTTP/1.1 Host: datacadamia.com
HTTP defines a set of operations. By order of most frequent:
|Method|| UnSafe |
Change state ?
|Description||Cached by default||Html element||Request Body Used||May be cached|
|GET||No|| (Default) Transfer a current representation of the target resource. |
Commonly used to download web pages
A GET request retrieve data.
GET requests will never cause an update or change to your data because they’re safe and idempotent.
|Yes||Html, Img, Link||No||Yes|
|POST||Yes|| Perform resource-specific processing on the request payload. |
Commonly used to transmit form submission data to a web server.
A POST request creates generally new resources..
|PATCH||Yes|| Update a resource |
With PATCH requests, you only need to provide the data you want to change
|PUT||Yes|| Replace all current representations of the target resource with the request payload. |
Create or update a resource
May be used for Data syncing
|HEAD||No||Same as GET, but only transfer the status line and header section.||No||No|
|DELETE||Yes||Remove all current representations of the target resource||No||No|
|CONNECT||No||Establish a tunnel to the server identified by the target resource.||No||No|
|OPTIONS||No||Describe the cross communication options for the target resource.||No||No|
|TRACE||No||Perform a message loop-back test along the path to the target resource.||No||No|
Other protocols based on HTTP can define additional methods.
All general-purpose servers MUST support the methods GET and HEAD. All other methods are OPTIONAL.
A request method is considered idempotent
The syntax is defined in the section 3.1.1. Request Line
In a http message
method = token
where token defines the method
The set of methods allowed by a target resource can be listed in an Allow header field (Section 7.4.1).
However, the set of allowed methods can change dynamically.
When a request method is received that is:
- unrecognized or not implemented by an origin server, the origin server SHOULD respond with the 501 (Not Implemented) status code.