GET Request Basics — Retrieving Resources
Learn how GET requests work in HTTP, including query parameters, caching behavior, and when to use GET vs other methods.
Detailed Explanation
How GET Works
The GET method is the most fundamental HTTP method. It requests a representation of the specified resource. GET requests should only retrieve data and must not change the state of the server.
Key Properties
| Property | Value |
|---|---|
| Safe | Yes |
| Idempotent | Yes |
| Cacheable | Yes |
| Request Body | Not expected |
Query Parameters
GET requests carry data through query parameters appended to the URL:
GET /users?page=2&limit=10&sort=name HTTP/1.1
Host: api.example.com
Caching Behavior
GET responses are cacheable by default. Servers control caching with headers:
Cache-Control: max-age=3600
ETag: "abc123"
Last-Modified: Thu, 01 Jan 2026 00:00:00 GMT
Browsers and CDNs can store and reuse GET responses, reducing server load and improving performance. The 304 Not Modified status code is returned when the cached version is still valid.
Common Status Codes
- 200 OK — Resource found and returned
- 301 Moved Permanently — Resource has a new URL
- 304 Not Modified — Cached version is still valid
- 404 Not Found — Resource does not exist
GET vs POST for Data Retrieval
Always use GET when you only need to read data. GET requests can be bookmarked, shared, cached, and indexed by search engines. POST should only be used when the request changes server state.
Use Case
Every time you type a URL in a browser, open an API documentation page, or fetch data from a REST endpoint, a GET request is sent. It is the default method for all hyperlinks and browser address bar navigations.