GET
What is it?
GET is an HTTP method used to retrieve data from a server without causing any side effects. GET requests should only fetch data and never modify server state. They are idempotent, meaning the same request always produces the same result, and cacheable by browsers. Data is sent via URL query parameters, making GET requests bookmarkable and visible in browser history.
Practical example
When you visit a product page at /products/123, your browser sends a GET request to the server. The server retrieves the product with ID 123 from the database and returns the data as HTML for a webpage or JSON for an API. Since GET does not modify anything, refreshing the page or visiting the same URL later is completely safe and shows current product information each time.
Test your knowledge
What is a characteristic of GET requests?