PUT

What is it?

PUT is an HTTP method used to update or completely replace an existing resource on the server. When sending a PUT request, you provide the complete new version of the resource, and the server replaces the old version entirely. PUT is idempotent, so sending the same PUT request multiple times has the same effect as sending it once, making it safe to retry failed requests.

Practical example

To update a user profile, you send PUT /api/users/123 with a complete user object in the body containing all fields: name, email, phone, address, and preferences. Even if you only want to change the email address, you must include all other fields with their current values. If you omit the phone field, it will be set to null or removed. The server responds with the complete updated user object.

Test your knowledge

What is the difference between PUT and PATCH?

Ask Lex
Lex knows the context of this term and can give targeted explanations, examples, and extra context.
Tip: Lex replies briefly in the widget. For more detail, go to full screen mode.

Quick links