Skip to content

Commit 0d7e7c6

Browse files
author
Dean Karn
authored
Update README.md
1 parent 955793b commit 0d7e7c6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,13 @@ URL Params
6262
```go
6363
p := p.New()
6464

65-
// the matching param will be stored in the Context's params with name "id"
65+
// the matching param will be stored in the context's params with name "id"
6666
l.Get("/user/:id", UserHandler)
6767

68+
// extract params like so
69+
rv := pure.ReqestVars(r) // done this way so only have to extract from context once
70+
rv.Params().Get(paramname)
71+
6872
// serve css, js etc.. pure.RequestVars(r).Params().Get(pure.WildcardParam) will return the remaining path if
6973
// you need to use it in a custom handler...
7074
l.Get("/static/*", http.FileServer(http.Dir("static/")))
@@ -105,9 +109,9 @@ Decoding Body
105109
-------------
106110
currently JSON, XML, FORM + Multipart Form's are support out of the box.
107111
```go
108-
// first argument denotes yes or no I would like URL query parameter fields
112+
// second argument denotes yes or no I would like URL query parameter fields
109113
// to be included. i.e. 'id' in route '/user?id=val' should it be included.
110-
if err := c.Decode(true, maxBytes, &user); err != nil {
114+
if err := pure.Decode(r, true, maxBytes, &user); err != nil {
111115
log.Println(err)
112116
}
113117
```

0 commit comments

Comments
 (0)