mirror of
https://github.com/golang/go
synced 2024-11-26 20:01:19 -07:00
net/http: document that FormValue returns the empty string
Fixes #8137 Change-Id: Icd94bbe430a3ef333248425449b5fc678edb0343 Reviewed-on: https://go-review.googlesource.com/11410 Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
parent
33ce9c19d7
commit
2917ab2049
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user