GET vs POST — What's the Difference in HTTP?
GET requests data and should have no side effects; POST submits data and can change server state. Learn the practical differences and when to use each.
Published September 20, 2026
GET retrieves data and puts parameters in the URL; POST sends data in the request body to create or change something. GET is safe and cacheable, POST is not.
The concept
GET requests must not change server state, so browsers cache them and bookmark them. Parameters are visible in the URL, logs and history, and URLs have length limits.
POST carries its payload in the body, can be large, and is not cached or repeated automatically (browsers warn before resubmitting). It is the usual choice for forms and API creates.
On the wire
Practical examples
GET with fetch
const res = await fetch('/api/users?role=admin')POST JSON
await fetch('/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name: 'Ada' })
})curl equivalents
curl 'https://x.com/api?id=1'
curl -X POST https://x.com/api -d 'id=1'Common mistakes
- Sending passwords in a GET query string.
- Using GET for actions that modify data (crawlers may trigger them).
- Assuming POST is secure by itself — it still needs HTTPS.
Key takeaways
- GET reads; POST writes.
- GET is cacheable and idempotent; POST is neither.
- Never put secrets in URLs.
FAQ
Can GET have a body?
Technically allowed but unreliable; avoid it.
Is POST more secure?
Not inherently; both are visible without HTTPS.