mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net/http: clarify docs on Request.Proto field
No need to say "by default" because there is no alternative and no way to override. Always HTTP/2.0 is officially spelled HTTP/2 these days. Fixes #13985 harder Change-Id: Ib1ec03cec171ca865342b8e7452cd4c707d7b770 Reviewed-on: https://go-review.googlesource.com/18720 Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
5b588e6682
commit
3092a63a64
2 changed files with 6 additions and 2 deletions
|
|
@ -93,8 +93,8 @@ type Request struct {
|
||||||
// The protocol version for incoming server requests.
|
// The protocol version for incoming server requests.
|
||||||
//
|
//
|
||||||
// For client requests these fields are ignored. The HTTP
|
// For client requests these fields are ignored. The HTTP
|
||||||
// transport code uses either HTTP/1.1 or HTTP/2.0 by default,
|
// client code always uses either HTTP/1.1 or HTTP/2.
|
||||||
// depending on what the server supports.
|
// See the docs on Transport for details.
|
||||||
Proto string // "HTTP/1.0"
|
Proto string // "HTTP/1.0"
|
||||||
ProtoMajor int // 1
|
ProtoMajor int // 1
|
||||||
ProtoMinor int // 0
|
ProtoMinor int // 0
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,10 @@ const DefaultMaxIdleConnsPerHost = 2
|
||||||
//
|
//
|
||||||
// A Transport is a low-level primitive for making HTTP and HTTPS requests.
|
// A Transport is a low-level primitive for making HTTP and HTTPS requests.
|
||||||
// For high-level functionality, such as cookies and redirects, see Client.
|
// 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 {
|
type Transport struct {
|
||||||
idleMu sync.Mutex
|
idleMu sync.Mutex
|
||||||
wantIdle bool // user has requested to close all idle conns
|
wantIdle bool // user has requested to close all idle conns
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue