Idempotent
PUT HTTP Method
PUT requests replace the target resource with the request content.
Meaning
The client asks the server to store the enclosed representation at the target URI.
Common uses
Use PUT when the client is replacing a known resource or writing to a known URL.
What to check
Check that the request contains the full replacement representation and that precondition headers prevent accidental overwrites when needed.
Example request
PUT /articles/123 HTTP/1.1
Host: example.com
Content-Type: application/json
{"title":"Updated article"}Properties
- Safe
- No. This method can change server state.
- Idempotent
- Yes. Repeating the same request should have the same intended effect.
- Cacheable
- No
- Request body
- Usually yes
References
- Registry
- IANA HTTP Method Registry
- Guide
- MDN PUT