Skip to content

net/http: Request.ParseForm documentation not correct. #8067

Closed
@gopherbot

Description

@gopherbot

by roberts@google.com:

The documentation for this method is not quite correct.

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.



To access multiple values of the same key, you need to use Request's Form or PostForm
field, not call ParseForm to get the additional values.

Example Code:

http://play.golang.org/p/th6LOVj5i3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions