Commit 77c13021 authored by Luka Zitnik's avatar Luka Zitnik Committed by Brad Fitzpatrick

net/http: document that ParseForm consumes Request.Body

Fixes #35620

Change-Id: I71bc56ec7a7507d14b4f013177b4b816bb1a2094
Reviewed-on: https://go-review.googlesource.com/c/go/+/212458Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 4b1b18d1
...@@ -1223,17 +1223,17 @@ func parsePostForm(r *Request) (vs url.Values, err error) { ...@@ -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 // For all requests, ParseForm parses the raw query from the URL and updates
// r.Form. // r.Form.
// //
// For POST, PUT, and PATCH requests, it also parses the request body as a form // For POST, PUT, and PATCH requests, it also reads the request body, parses it
// and puts the results into both r.PostForm and r.Form. Request body parameters // as a form and puts the results into both r.PostForm and r.Form. Request body
// take precedence over URL query string values in r.Form. // 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 // For other HTTP methods, or when the Content-Type is not
// application/x-www-form-urlencoded, the request Body is not read, and // application/x-www-form-urlencoded, the request Body is not read, and
// r.PostForm is initialized to a non-nil, empty value. // 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. // ParseMultipartForm calls ParseForm automatically.
// ParseForm is idempotent. // ParseForm is idempotent.
func (r *Request) ParseForm() error { func (r *Request) ParseForm() error {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment