COMPUTER ENGINEER

Blog
HTTP / HTTPS / TLS6 min study
07/ 70

Methods and request semantics

Methods, safety and idempotency

Repeatability and read-only intent are distinct.

UnderstandStudy an examplePractise

Understand the concept

GET and HEAD are defined for retrieval; deleting orders through GET violates safe semantics. Incidental logging is different from the business effect requested by a client. PUT creates or replaces the targeted representation; DELETE requests removal.

Idempotency concerns intended effect, not identical responses. A DELETE may return 204 then 404 while leaving the same absent-resource state. POST is not generally idempotent. PATCH depends on the operations in the patch document.

HEAD provides GET-like metadata without a response body; some fields can describe the body a GET would send. OPTIONS can describe capabilities and is used for CORS preflight. Method names do not replace authorisation.

WHEN TO USE IT

Design correct retries, crawlers and API contracts.

COMMON PITFALL

Assuming idempotency requires identical responses.

01 / PRACTICE

One topic. Three levels of depth.

HTTP / illustrative example
GET /products/7 HTTP/1.1
Host: example.test

Retrieval intent.

This page does not send requests to external servers. Messages are readable HTTP/1.1 illustrations, not HTTP/2 or HTTP/3 wire dumps. example.test is reserved for examples. Run commands and JavaScript only in your own test environment; never publish real tokens or cookies.

02 / YOUR TURN

Try it yourself first.

Is immediately retrying a timed-out payment POST safe?

Show the solution and explanation
Worked solution
Unknown outcome → reconcile / idempotency contract

Not by default; the first payment may have succeeded. Use an explicit retry contract and queryable operation identity.