aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/request.go
diff options
context:
space:
mode:
authorLuka Zitnik <luka.zitnik@gmail.com>2019-12-24 01:08:11 +0100
committerBrad Fitzpatrick <bradfitz@golang.org>2020-01-08 15:48:04 +0000
commit77c13021dd401945711ff40f16a5040a075fcef9 (patch)
treeb9429b9c845727ae18efc96ed3980889960ea624 /src/net/http/request.go
parent4b1b18d1060b82d4df273e23d81033dfacf4d5bb (diff)
downloadgo-77c13021dd401945711ff40f16a5040a075fcef9.tar.gz
go-77c13021dd401945711ff40f16a5040a075fcef9.zip
net/http: document that ParseForm consumes Request.Body
Fixes #35620 Change-Id: I71bc56ec7a7507d14b4f013177b4b816bb1a2094 Reviewed-on: https://go-review.googlesource.com/c/go/+/212458 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/net/http/request.go')
-rw-r--r--src/net/http/request.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/net/http/request.go b/src/net/http/request.go
index 8dd9fe199f..88fa0939f2 100644
--- a/src/net/http/request.go
+++ b/src/net/http/request.go
@@ -1223,17 +1223,17 @@ func parsePostForm(r *Request) (vs url.Values, err error) {
// For all requests, ParseForm parses the raw query from the URL and updates
// r.Form.
//
-// For POST, PUT, and PATCH requests, it also parses the request body as a form
-// and puts the results into both r.PostForm and r.Form. Request body parameters
-// take precedence over URL query string values in r.Form.
+// For POST, PUT, and PATCH requests, it also reads the request body, parses it
+// as a form and puts the results into both r.PostForm and r.Form. Request body
+// parameters take precedence over URL query string values in r.Form.
+//
+// If the request Body's size has not already been limited by MaxBytesReader,
+// the size is capped at 10MB.
//
// For other HTTP methods, or when the Content-Type is not
// application/x-www-form-urlencoded, the request Body is not read, and
// r.PostForm is initialized to a non-nil, empty value.
//
-// If the request Body's size has not already been limited by MaxBytesReader,
-// the size is capped at 10MB.
-//
// ParseMultipartForm calls ParseForm automatically.
// ParseForm is idempotent.
func (r *Request) ParseForm() error {