Conditions | 2 |
Total Lines | 11 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | package response |
||
22 | func (resp *CommonResponse) ParseFromHTTPResponse(httpResponse *http.Response) (err error) { |
||
23 | defer httpResponse.Body.Close() |
||
24 | body, err := hookReadAll(ioutil.ReadAll)(httpResponse.Body) |
||
25 | if err != nil { |
||
26 | return |
||
27 | } |
||
28 | resp.httpStatus = httpResponse.StatusCode |
||
29 | resp.httpHeaders = httpResponse.Header |
||
30 | resp.httpContentBytes = body |
||
31 | resp.httpContentString = string(body) |
||
32 | return |
||
33 | } |
||
54 |