Skip to content

net/http: Request.FormValue document return value if missing key #8137

Closed
@gopherbot

Description

@gopherbot

by nicolas.riesco:

What does 'go version' print?

go version go1.3rc1 linux/amd64

What steps reproduce the problem?
If possible, include a link to a program on play.golang.org.

1. godoc net/http FormValue
2.
3.

What happened?

[...]
func (r *Request) FormValue(key string) string
    FormValue returns the first value for the named component of the query.
    POST and PUT body parameters take precedence over URL query string
    values. FormValue calls ParseMultipartForm and ParseForm if necessary.
    To access multiple values of the same key use ParseForm.

What should have happened instead?

Please, document that an empty string is returned if they the requested key is missing.

Please provide any additional information below.

Is the documentation of this method up to date? The source code only calls
ParseMultipartForm.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions