Safe method

A safe method has read-only requested semantics even though handling it can still produce incidental side effects.

  • methods
  • semantics
  • safety

Definition

A safe method has read-only requested semantics. GET, HEAD, OPTIONS, TRACE, and standardized QUERY are safe; safety is about what the client asks the resource to do.

GET /reports/today HTTP/1.1

Expected result: the request asks to retrieve a representation, not to change resource state. Logging, metering, or other incidental server effects do not change GET’s defined semantics.

Why it matters

Clients, crawlers, and caches can make decisions based on safe semantics. An application must not hide a state-changing action behind a safe method.

Primary sources