When do you use GET versus POST?
PICTURE THIS: RAG CHATBOT
Simple meaning
GET is safe and idempotent: it reads a resource and must not change server state beyond logging.
WHY — REST instead of guessing?
Why interviewers care about REST:
contrast on REST, not two memorised paragraphs.
the developer, then one case where picking wrong hurts.
Name the idea, why it exists, then one short example.
End with when you use it and one common pitfall.
STEPS — What happens step by step?
Before you speak the answer, walk the interviewer through these steps:
- 1GET is safe and
idempotent: it reads a resource and must not change server state beyond logging.
- 2POST is neither safe
nor idempotent
- 3it typically creates a
resource or triggers a process.
- 4Browsers and caches may
retry GET freely
- 5they must not retry
POST without an idempotency key.
- 6Close
When you pick this over the alternative.
EXAMPLE — See it in action
Here's a short line you can speak, broken into clear beats:
Note: Adapt this scaffold to your own project — keep it under 60–90 seconds.
Key takeaway
GET is safe and idempotent: it reads a resource and must not change server state beyond logging. POST is neither safe nor idempotent