Skip to content
Ameen Abozaid
Planned lessonJNR-017-L01

Methods revisited: safety and idempotency

  • Lesson 1 of 6
  • Junior
On This Lesson 4 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

classify HTTP methods and explain why retries depend on it.

Planned topics

  • Safe means the request does not change server state (reading only). GET, HEAD, OPTIONS are safe.
  • Idempotent means doing it once or ten times leaves the server in the same state. GET, PUT, DELETE are idempotent.
  • POST is neither safe nor idempotent: two identical calls can create two orders.
  • PATCH is not guaranteed idempotent; it depends on what the patch says.
  • Clients, proxies, and load balancers may retry idempotent calls automatically. A non-idempotent retry can duplicate work.
Draft outline details

Demonstration

MethodSafeIdempotent
GETyesyes
PUTnoyes
DELETEnoyes
POSTnono

Check your understanding

Why is it fine to retry PUT /products/5 after a timeout?

Show answer

Repeating it leaves the same final state.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.