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

← All HTTP methods · HTTP status codes · HTTP headers