Suggest an editImprove this articleRefine the answer for “What is PUT used for?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**PUT** is an **HTTP method** used to **fully update (replace) a resource on the server**. In simple terms, PUT is needed to replace existing data with new data entirely. **Key point:** PUT is an idempotent method: calling it again with the same data gives the same result, unlike POST.Shown above the full answer for quick recall.Answer (EN)Image**PUT** is an **HTTP method** used to **fully update (replace) a resource on the server**. In simple terms: **PUT is needed to replace existing data with new data entirely**. --- ## The main purpose of PUT PUT is used when you need to: - update an existing resource - replace its current state with a new one - save data at a specific address (URL) The typical meaning of PUT: > "Here is new data, make the resource look *exactly* like this" --- ## How PUT works 1. The client sends an HTTP request with the **PUT** method 2. The request body carries **all of the resource's data** 3. The server: - finds the resource by its URL - **fully replaces its content** 4. The server returns an HTTP response If some field is missing from the PUT request, it may be **removed or reset**. --- ## Where data is sent with PUT Data is sent: - **in the request body** - usually as JSON or XML An example of what the request means: ```json { "id": 123, "name": "Alice", "email": "alice@example.com" } ``` --- ## A key property of PUT ### Idempotency PUT is an **idempotent method**: - send PUT once, and the resource is updated - send the same PUT 10 times, and the result is **the same** This is a key difference from POST. --- ## PUT vs POST (short and clear) - **POST** - create a resource - the action can repeat with a different result - **PUT** - update (or replace) a resource - a repeated request gives the same result A way to remember it: - **POST** - "create" - **PUT** - "replace" --- ## Real-life example PUT is like: - replacing a form entirely with a new version - rewriting a document completely - saving a file over the old one You are **not fixing individual lines**, you are **changing everything at once**.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.