Unmarshal the request data into v
(r *http.Request, v interface{})
| 12 | |
| 13 | // Unmarshal the request data into v |
| 14 | func Unmarshal(r *http.Request, v interface{}) error { |
| 15 | err := unmarshalBody(r, v) |
| 16 | if err != nil { |
| 17 | return err |
| 18 | } |
| 19 | err = unmarshalURL(r.URL, v) |
| 20 | if err != nil { |
| 21 | return err |
| 22 | } |
| 23 | return nil |
| 24 | } |
| 25 | |
| 26 | func unmarshalBody(r *http.Request, v interface{}) error { |
| 27 | contentType := r.Header.Get("Content-Type") |