Closed mhutchinson closed 2 months ago
This is true when the body is fully read. Does the body need to be closed when the io.ReadAll
returns an error?
The contract doesn't say anything about that: https://pkg.go.dev/net/http#Request (you need to scroll down a bit to get to Body, and there's no way to link to the field members for some reason)
Note that the contract is different on the http client request. That body does need to be closed. Carefully.
Note that the contract is different on the http client request. That body does need to be closed. Carefully.
Found it, thanks!
From Request.Body docs: The Server will close the request body. The ServeHTTP Handler does not need to.