File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,13 @@ URL Params
6262``` go
6363p := 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"
6666l.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...
7074l.Get (" /static/*" , http.FileServer (http.Dir (" static/" )))
@@ -105,9 +109,9 @@ Decoding Body
105109-------------
106110currently 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```
You can’t perform that action at this time.
0 commit comments