A query parameter supplies an optional key-value input to an HTTP request. It follows the path after `?`; separate multiple `key=value` pairs with `&`. For example, `?lang=en` supplies the key `lang` with the value `en`. Query parameters can filter resources or provide other request options. section 8.6.5 section 8.2.2
Choose a path parameter when the URL must identify one resource, such as `/games/{gameID}`. Choose a query parameter for an optional choice, such as the language of a new game. Unlike the resource identifier in the path, the query choice need not be present. section 8.2.2 section 8.6.5
Read a language option in Go
For `http://localhost:8080/game?lang=en`, define `Lang = "lang"` and read `lang := r.URL.Query().Get(api.Lang)` in the handler. Check `len(lang) > 0` before using it. The shown handler prints the value; creating a game in that language remains a TODO. section 8.6.5
The same pattern can make week navigation optional: read `r.URL.Query().Get("week")` and default to `time.Now()` when it is absent. If a URL can request a future week, check the value in the handler rather than relying on a hidden navigation link. section 11.5.1






























