PUT updates an existing resource identified by a URI. An endpoint combines the PUT method with a resource path such as /games/{game_id}; repeated calls should leave an idempotent resource state. section 8.2
Implement a PUT endpoint by making the resource and request contract explicit:
- Use a path identifying the resource, such as /games/{game_id}. section 8.2
- Decode the JSON request body into a typed request structure. section 8.2.3
- Send the complete resource representation when appropriate; send only fields needed for a focused update when the API permits it. section 8.2.3
Submitting a game guess
A Gordle service uses PUT /games/{game_id} to change a game's status. The client sends curl -v -X PUT "http://localhost:8080/games/123456" -d '{"guess":"hello"}'. The handler decodes the guess from the JSON body and updates the identified game. section 8.2.3







