fromHTTP panics with an httputil value on failure
(req *http.Request)
| 309 | |
| 310 | // fromHTTP panics with an httputil value on failure |
| 311 | func (dr *DescribeRequest) fromHTTP(req *http.Request) { |
| 312 | switch { |
| 313 | case httputil.IsGet(req): |
| 314 | dr.fromHTTPGet(req) |
| 315 | case req.Method == "POST": |
| 316 | dr.fromHTTPPost(req) |
| 317 | default: |
| 318 | panic("Unsupported method") |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | func (dr *DescribeRequest) fromHTTPPost(req *http.Request) { |
| 323 | err := json.NewDecoder(req.Body).Decode(dr) |
no test coverage detected