We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 34dda71 + 910dd3a commit b128961Copy full SHA for b128961
README.md
@@ -65,8 +65,11 @@ r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler)
65
The names are used to create a map of route variables which can be retrieved calling `mux.Vars()`:
66
67
```go
68
-vars := mux.Vars(request)
69
-category := vars["category"]
+func ArticlesCategoryHandler(w http.ResponseWriter, r *http.Request) {
+ vars := mux.Vars(r)
70
+ w.WriteHeader(http.StatusOK)
71
+ fmt.Fprintf(w, "Category: %v\n", vars["category"])
72
+}
73
```
74
75
And this is all you need to know about the basic usage. More advanced options are explained below.
0 commit comments