mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net/http: update NewRequestWithContext wrong link to NewRequest
Fixes #70874
Change-Id: Icbcfc95e6b45521880287dcc3bc8609461a3b401
GitHub-Last-Rev: 05276c56b0
GitHub-Pull-Request: golang/go#70877
Reviewed-on: https://go-review.googlesource.com/c/go/+/637035
Reviewed-by: qiu laidongfeng2 <2645477756@qq.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
c112c0af13
commit
7a2e88e911
1 changed files with 3 additions and 3 deletions
|
|
@ -873,9 +873,9 @@ func NewRequest(method, url string, body io.Reader) (*Request, error) {
|
||||||
//
|
//
|
||||||
// NewRequestWithContext returns a Request suitable for use with
|
// NewRequestWithContext returns a Request suitable for use with
|
||||||
// [Client.Do] or [Transport.RoundTrip]. To create a request for use with
|
// [Client.Do] or [Transport.RoundTrip]. To create a request for use with
|
||||||
// testing a Server Handler, either use the [NewRequest] function in the
|
// testing a Server Handler, either use the [net/http/httptest.NewRequest] function,
|
||||||
// net/http/httptest package, use [ReadRequest], or manually update the
|
// use [ReadRequest], or manually update the Request fields.
|
||||||
// Request fields. For an outgoing client request, the context
|
// For an outgoing client request, the context
|
||||||
// controls the entire lifetime of a request and its response:
|
// controls the entire lifetime of a request and its response:
|
||||||
// obtaining a connection, sending the request, and reading the
|
// obtaining a connection, sending the request, and reading the
|
||||||
// response headers and body. See the Request type's documentation for
|
// response headers and body. See the Request type's documentation for
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue