read
HTTP GET
Requests a representation of the specified resource. It is the most common HTTP method and should have no side effects on the server.
GET /path HTTP/1.1 Properties
| Property | Value / Meaning |
|---|---|
| Safe | Yes - GET must not modify server state; it only retrieves data. |
| Idempotent | Yes - repeating the same GET produces the same result on the server. |
| Cacheable | Yes - responses are cached by default unless headers say otherwise. |
| Has body | No - GET requests should not contain a message body (allowed but has no defined semantics). |
| Body in response | Yes - the response body carries the requested resource representation. |
Examples
curl https://api.example.com/users/42 Fetch user 42 as JSON or default representation.
curl -H 'Accept: application/json' https://api.example.com/users Content negotiation via Accept header.
curl 'https://api.example.com/search?q=http&limit=10' Pass parameters via query string, not a body.
GET /index.html HTTP/1.1\nHost: example.com Raw HTTP/1.1 request line and Host header.
Gotcha
Never use GET for actions that change state (deletes, purchases) - crawlers and prefetchers will trigger them. Sensitive data in query strings gets logged in server access logs and browser history.
Related methods
HTTP HEAD
Identical to GET but the server must not return a message body in the response. Used to inspect headers - size, type, last-modified - without downloading the payload.
HTTP POST
Submits an entity to the specified resource, often causing a change in state or side effect on the server. Used for creating resources, form submissions, and RPC-style calls.
HTTP OPTIONS
Asks the server which communication options (methods, headers, CORS rules) are available for the target resource. Widely used by browsers as the CORS preflight before non-simple cross-origin requests.