On Monday, 10 September 2018 17:27:43 UTC+3, Pierre Durand wrote:
>
> When I learned Go a few years ago, I was told to always defer/close the 
> HTTP request body, otherwise it will cause a resource leak.
>
> But today I read this: https://golang.org/pkg/net/http/#Request.Body
>         // The Server will close the request body. The ServeHTTP
>         // Handler does not need to.
>
> This is for Server requests. 

> Am I misunderstanding something ?
>
> Thanks.
>

You need to close the request body. 
The documentation you linked to says; 

*For client requests ....  The HTTP Client's Transport is responsible for 
calling the Close method *

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to