lookup> PUT

PUT

Replaces the target resource with the request payload, or creates it if it does not exist. Idempotent.

unsafeidempotentnot cacheableRFC7231#4.3.4
PropertyValue
Safe (does not modify state)No
Idempotent (repeatable)Yes
CacheableNo

Replaces the target resource with the request payload, or creates it if it does not exist. Idempotent.

curl -X PUT https://api.example.com/users/1 -H "Content-Type: application/json" -d '{"name":"Ada"}'
PUT /api/users/1 HTTP/1.1
Host: example.com
Content-Type: application/json

{"name":"Ada"}
PUTPATCH
Replace the whole resourceApply a partial update
IdempotentNot necessarily
Full body requiredSmaller payload

Is the PUT method safe?

PUT is not a safe method — calling it can change resource state.

What happens if I send PUT repeatedly?

PUT is idempotent — repeated requests have the same effect as a single request.

All HTTP methods

Related status codes

Related headers