An HTTP request message tells a server what action to take at an address. For an endpoint, the decisive pair is the method and path: GET accesses a resource; POST creates one or asks the server to process data. A request can also carry headers and a body, depending on what the endpoint needs. section 8.2 section 8.0
Create a game without submitting data
Start the Go server on port 8080, then run `curl -v -X POST localhost:8080/games`. The request uses `POST /games`; it needs no input because the server creates an empty game. The successful endpoint returns a game identifier for later status and guess requests. A plain `curl -v localhost:8080/games` sends GET instead and receives `405 Method Not Allowed`. section 8.2.1
On the server, route the POST method and `/games` path to a handler. The handler writes a response, not another request: set `Content-Type: application/json`, write `201 Created`, then encode the game response. Write the status before the response body; writing the body first commits a default `200 OK`. section 8.2.1
Listing 11.33 index.html: Form to create a habit
<form action="/create" method="post">
<label for="habitName">Objective:</label> #1
<input type="text" id="habitName" name="habitName">
<label for="habitFrequency">Weekly frequency:</label> #2
<input type="number" id="habitFrequency" name="habitFrequency">
<button>Create</button>
</form>
This HTML form makes a different POST request. Its `action` supplies `/create`, its `method` supplies POST, and its named inputs provide the habit values sent to the server. section 11.4.1
Choose the request method for the action, then check that the path, submitted values, and expected response agree. Creating a game needs no submitted values; creating a habit needs values from form inputs. section 8.2.1 section 11.4.1













