Closed browny closed 5 years ago
@browny Thanks for the PR! I have two requests:
ContentLength
based on the length of the string and the byte slice.io.CopyN()
or simply resp.Body.Len() == resp.ContentLength
. Something along those lines would be awesome :smiley:
When using
httpmock
withgrequests
http client, thegrequests.Response.String()
method will fail to read http response body because the propertyContentLength
of the mocked http.Response is0
. (WhenContentLength == 0
, grequests doesn't copy http response body to its own Response, refer to here)According to the godoc of
http.Response
, I think make it as-1
would be good.thanks :)