liveBook · Manning

HTTP PUT method

As explained in Grokking Software Architecture

PUT is an HTTP method for creating or replacing the representation of a resource at a specified target URI.

PUT targets a resource URI to create or replace its representation. Repeating the same update leaves the resource unchanged, so clients can retry after network failures. section 6.4.1

A safe retry

Setting /orders/1 to “Shipped” ten times still leaves it “Shipped.” By contrast, repeating a POST to create an order can cause duplicate effects. section 6.4.1

How Grokking Software Architecture covers it

How deep it goes
Explains PUT as an idempotent update, then applies it to retries and an UPSERT-style payment contract.
Examples
Uses repeatedly setting an order to Shipped and retrying a payment request with a transaction ID.
What you can do after
Apply PUT to updates that must tolerate retries, including transaction-ID payment contracts designed to avoid duplicate charges.
How it connects
Connects PUT with REST, idempotency, POST, DELETE, and network retries.

Also explained in

Compare how 10 books explain HTTP PUT method →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.