ToString response body to string
(response *http.Response)
| 208 | |
| 209 | // ToString response body to string |
| 210 | func (h *HTTPClient) ToString(response *http.Response) (string, error) { |
| 211 | defer response.Body.Close() |
| 212 | |
| 213 | body, err := ioutil.ReadAll(response.Body) |
| 214 | |
| 215 | if err != nil { |
| 216 | return "", err |
| 217 | } |
| 218 | |
| 219 | return string(body), nil |
| 220 | } |
| 221 | |
| 222 | // GetStatusCode response status code |
| 223 | func (h *HTTPClient) GetStatusCode(response *http.Response) int { |
no outgoing calls