mirror of
https://github.com/soypat/lneto.git
synced 2026-09-04 05:49:02 +00:00
add PathValue example
This commit is contained in:
@@ -60,6 +60,11 @@ func ExampleMuxSlice_query_forms_multipart() {
|
|||||||
|
|
||||||
var mux httphi.MuxSlice
|
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) {
|
mux.Handle("/query", func(ex *httphi.Exchange) {
|
||||||
// query parameter in URL.
|
// query parameter in URL.
|
||||||
const decodeQuery = true
|
const decodeQuery = true
|
||||||
|
|||||||
Reference in New Issue
Block a user