diff --git a/src/net/http/request.go b/src/net/http/request.go index c2f5f26a4c..16c5bb43ac 100644 --- a/src/net/http/request.go +++ b/src/net/http/request.go @@ -93,8 +93,8 @@ type Request struct { // The protocol version for incoming server requests. // // For client requests these fields are ignored. The HTTP - // transport code uses either HTTP/1.1 or HTTP/2.0 by default, - // depending on what the server supports. + // client code always uses either HTTP/1.1 or HTTP/2. + // See the docs on Transport for details. Proto string // "HTTP/1.0" ProtoMajor int // 1 ProtoMinor int // 0 diff --git a/src/net/http/transport.go b/src/net/http/transport.go index c7e6e1cfca..fc0ae36b51 100644 --- a/src/net/http/transport.go +++ b/src/net/http/transport.go @@ -57,6 +57,10 @@ const DefaultMaxIdleConnsPerHost = 2 // // A Transport is a low-level primitive for making HTTP and HTTPS requests. // For high-level functionality, such as cookies and redirects, see Client. +// +// Transport uses HTTP/1.1 for HTTP URLs and either HTTP/1.1 or HTTP/2 +// for HTTPS URLs, depending on whether the server supports HTTP/2. +// See the package docs for more about HTTP/2. type Transport struct { idleMu sync.Mutex wantIdle bool // user has requested to close all idle conns