add PathValue example

This commit is contained in:
Patricio Whittingslow
2026-07-29 16:29:51 -03:00
parent 6b54f74dd5
commit 29fcec9cb7
+5
View File
@@ -60,6 +60,11 @@ func ExampleMuxSlice_query_forms_multipart() {
var mux httphi.MuxSlice
mux.Handle("/users/{id}", func(ex *httphi.Exchange) {
userID := ex.PathValue("id")
fmt.Printf("someone requested data for user %s", userID)
})
mux.Handle("/query", func(ex *httphi.Exchange) {
// query parameter in URL.
const decodeQuery = true