Skip to content
BENIBIX Learn

PUT Request

Infrastructure🌐 NetworkingRequests and Responses

Also known as PUT, HTTP PUT, PUT Method

A request that swaps the whole thing for the one you send.

Think of it like

Think of it like a binder. You swap a whole page for a new one.

Example

Jack sends a PUT with his full profile: name, email and city. The server swaps the old profile for this one.

Why it matters

PUT gives a clear, repeatable way to save a whole record. Retrying it cannot make a mess.

Definition

A PUT request replaces a whole thing on the server with the version you send. You send every field, and whatever you leave out may be wiped. If the thing does not exist yet, some servers create it. Sending the same PUT twice leaves the same result as sending it once. That makes it safe to retry after a network error.

Example code

http
PUT /api/users/42 HTTP/1.1
Content-Type: application/json

{"name": "Jack", "city": "Leeds"}
The whole user record is sent, and it replaces the old one.

Common mistake

Sending a PUT with only the field you changed. The other fields may be blanked out.

Key takeaways

  1. 1
    Replaces the whole thing. Send every field.
  2. 2
    Same result twice. Safe to retry.
  3. 3
    Not for small edits. PATCH is for those.

Compare

Learn it properly