We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7765576 commit cfaee19Copy full SHA for cfaee19
src/net/http/request.go
@@ -345,6 +345,10 @@ func (r *Request) Context() context.Context {
345
// For outgoing client request, the context controls the entire
346
// lifetime of a request and its response: obtaining a connection,
347
// sending the request, and reading the response headers and body.
348
+//
349
+// The only exception is for responses with writable bodies where
350
+// the cancellation of the context will not close the body.
351
+// See Response.Body for instances where the body is writable.
352
func (r *Request) WithContext(ctx context.Context) *Request {
353
if ctx == nil {
354
panic("nil context")
0 commit comments