mirror of
https://github.com/soypat/lneto.git
synced 2026-08-11 18:33:46 +00:00
add PathValue example
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user