Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Query string
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Web forms === One of the original uses was to contain the content of an [[form (HTML)|HTML form]], also known as web form. In particular, when a form containing the fields <code>field1</code>, <code>field2</code>, <code>field3</code> is submitted, the content of the fields is encoded as a query string as follows: {{quote|1=<code>field1=value1&field2=value2&field3=value3...</code>}} * The query string is composed of a series of field-value pairs. * Within each pair, the field name and value are separated by an [[equals sign]], "<code>=</code>". * The series of pairs is separated by the [[ampersand]], "<code>&</code>" ([[semicolons]] "<code>;</code>" are not recommended by the [[W3C]] anymore, see below). While there is no definitive standard, most [[web framework]]s allow multiple values to be associated with a single field (e.g. <code>field1=value1&field1=value2&field2=value3</code>).<ref>{{cite web|url=https://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getParameterValues(java.lang.String) |title=ServletRequest (Java EE 6 )|website=docs.oracle.com |date=2011-02-10|access-date=2013-09-08}}</ref><ref>{{cite web|url=https://stackoverflow.com/questions/1746507/authoritative-position-of-duplicate-http-get-query-keys |title=uri β Authoritative position of duplicate HTTP GET query keys|website=Stack Overflow |date=2013-06-09|access-date=2013-09-08}}</ref> For each [[Field (computer science)|field]] of the form, the query string contains a pair <code><var>field</var>=<var>value</var></code>. Web forms may include fields that are not visible to the user; these fields are included in the query string when the form is submitted. This convention is a [[W3C]] recommendation.<ref name="w3c-recom">[https://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type Forms in HTML documents]. W3.org. Retrieved on 2013-09-08.</ref> In the recommendations of 1999, W3C recommended that all web servers support [[semicolon]] separators in addition to [[ampersand]] separators<ref>[http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2 Performance, Implementation, and Design Notes]. W3.org. Retrieved on 2013-09-08.</ref> to allow [[application/x-www-form-urlencoded]] query strings in URLs within HTML documents without having to entity escape ampersands. Since 2014, W3C recommends to use only [[ampersand]] as query separator.<ref name="w3c-recom-2014">{{cite web | url=https://www.w3.org/TR/2014/REC-html5-20141028/forms.html#url-encoded-form-data | title=4.10 Forms β HTML5 }}</ref> The form content is only encoded in the URL's query string when the form submission method is [[GET (HTTP)|GET]]. The same encoding is used by default when the submission method is [[POST (HTTP)|POST]], but the result is submitted as the [[HTTP request]] body rather than being included in a modified URL.<ref name="html5" />
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)