]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: document that FormValue returns the empty string
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 24 Jun 2015 10:34:06 +0000 (12:34 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 25 Jun 2015 01:17:32 +0000 (01:17 +0000)
Fixes #8137

Change-Id: Icd94bbe430a3ef333248425449b5fc678edb0343
Reviewed-on: https://go-review.googlesource.com/11410
Reviewed-by: Andrew Gerrand <adg@golang.org>
src/net/http/request.go

index 43d9de378ac5c69287ce7b732e0d77699f583ee7..cd50cb94590a64c83153b8e0c319ea4241a2bf71 100644 (file)
@@ -878,6 +878,7 @@ func (r *Request) ParseMultipartForm(maxMemory int64) error {
 // POST and PUT body parameters take precedence over URL query string values.
 // FormValue calls ParseMultipartForm and ParseForm if necessary and ignores
 // any errors returned by these functions.
+// If key is not present, FormValue returns the empty string.
 // To access multiple values of the same key, call ParseForm and
 // then inspect Request.Form directly.
 func (r *Request) FormValue(key string) string {
@@ -894,6 +895,7 @@ func (r *Request) FormValue(key string) string {
 // or PUT request body. URL query parameters are ignored.
 // PostFormValue calls ParseMultipartForm and ParseForm if necessary and ignores
 // any errors returned by these functions.
+// If key is not present, PostFormValue returns the empty string.
 func (r *Request) PostFormValue(key string) string {
        if r.PostForm == nil {
                r.ParseMultipartForm(defaultMaxMemory)