Added issue https://github.com/golang/go/issues/48860

On Thursday, 7 October 2021 at 08:36:25 UTC+1 Amnon wrote:

> Is it necessary for a http client to fully read the http response body?
>
> Opinion on the Go forums seems divided 
> https://forum.golangbridge.org/t/do-i-need-to-read-the-body-before-close-it/5594
>
> But a simple benchmark https://play.golang.org/p/5JDWYbRe0lD
> suggests that leaving unread data in the response body will prevent 
> the connection being reused, and much slower performance.
>
> The documentation https://pkg.go.dev/net/http states:
>
> "The client must close the response body when finished with it:"
>
> The following example does include a call to io.ReadAll(resp.Body) 
> but it does not spell out whether there would be a performance penalty
> for failing to read the entire body.
>
> It would be good if the standard library documentation was a bit more 
> explicit here.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/1169be3d-e5a5-4d15-aded-a7f795e5a25an%40googlegroups.com.

Reply via email to