<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.aletopedia.org/index.php?action=history&amp;feed=atom&amp;title=Query_string</id>
	<title>Query string - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.aletopedia.org/index.php?action=history&amp;feed=atom&amp;title=Query_string"/>
	<link rel="alternate" type="text/html" href="https://www.aletopedia.org/index.php?title=Query_string&amp;action=history"/>
	<updated>2026-12-04T06:42:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://www.aletopedia.org/index.php?title=Query_string&amp;diff=423799&amp;oldid=prev</id>
		<title>imported&gt;Zahrazamedahmedi: Reverted 1 edit by ~2026-57616-87 (talk): Unexplained content removal</title>
		<link rel="alternate" type="text/html" href="https://www.aletopedia.org/index.php?title=Query_string&amp;diff=423799&amp;oldid=prev"/>
		<updated>2026-10-29T05:01:27Z</updated>

		<summary type="html">&lt;p&gt;Reverted 1 edit by &lt;a href=&quot;/wiki/Special:Contributions/~2026-57616-87&quot; title=&quot;Special:Contributions/~2026-57616-87&quot;&gt;~2026-57616-87&lt;/a&gt; (&lt;a href=&quot;/index.php?title=User_talk:~2026-57616-87&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:~2026-57616-87 (page does not exist)&quot;&gt;talk&lt;/a&gt;): Unexplained content removal&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Part of a URL that assigns values to specified parameters}}&lt;br /&gt;
&lt;br /&gt;
A &amp;#039;&amp;#039;&amp;#039;query string&amp;#039;&amp;#039;&amp;#039; is an optional component [[String (computer science)|string]] of a [[uniform resource identifier|URI]], used to provide a set of one or more parameter values. When a URI is submitted to a [[Server (computing)|server]] in a request to access, or otherwise interact with, a resource, the server may adapt its response in relation to those parameters.&lt;br /&gt;
&lt;br /&gt;
[[File:Query string.png|frame|center|An [[address bar]] showing a URL with a two-parameter query string of &amp;lt;code&amp;gt;title=Query_string&amp;amp;action=edit&amp;lt;/code&amp;gt;|alt=An address bar on Google Chrome showing a URL with a two-parameter query string of &amp;quot;title=Query_string&amp;amp;action=edit&amp;quot;]]&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
The query string component is formally described in RFC&amp;amp;nbsp;3986 (&amp;#039;&amp;#039;Uniform Resource Identifier (URI): Generic Syntax&amp;#039;&amp;#039;) as &amp;quot;containing data&amp;quot; serving a purpose, in combination with the &amp;#039;&amp;#039;path&amp;#039;&amp;#039; component, of identifying a resource, with &amp;#039;&amp;#039;path&amp;#039;&amp;#039; being of hierarchical nature and query string being non-hierarchical.&amp;lt;ref name=&amp;quot;rfc3986&amp;quot;&amp;gt;{{cite web |url=http://tools.ietf.org/html/rfc3986 |title=RFC 3986 |author=T. Berners-Lee |author2=R. Fielding |author3=L. Masinter |date=January 2005}}&amp;lt;/ref&amp;gt;{{rp|3.4}} Conventionally however, query strings are used for more than just refining resource identification, including communicating the nature of intended interaction; providing data to be utilised in an interaction; or asserting authorisation for the request. Any content returned in response to a request may thus be altered in some way in response to query string data.&amp;lt;ref&amp;gt;{{Cite web |url=https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Query |title=URI query |access-date=2026-09-16 |quote=&amp;quot;Web servers can use the parameters to modify responses, like applying filtering, search, or sorting results, although this is implementation-specific.&amp;quot;}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
{{Main|Uniform Resource Identifier#Syntax}}&lt;br /&gt;
The URI query string component comes after the path component, separated by a question mark (&amp;lt;code&amp;gt;?&amp;lt;/code&amp;gt;), and before the optional [[URI fragment|fragment]] component, separated by a [[number sign]] (&amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;),&amp;lt;ref name=&amp;quot;rfc3986&amp;quot;/&amp;gt;{{rp|3.4}} per the following URI format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;abnf&amp;quot;&amp;gt;&lt;br /&gt;
scheme &amp;quot;:&amp;quot; [&amp;quot;//&amp;quot; authority] path [&amp;quot;?&amp;quot; query] [&amp;quot;#&amp;quot; fragment]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The structure of the query string is not well defined in the URI specification itself.&amp;lt;ref name=&amp;quot;rfc3986&amp;quot;/&amp;gt;{{rp|3.4}} Conventionally it consists of one or more [[Attribute-value pair|key-value pairs]], each usually in a &amp;lt;code&amp;gt;key=value&amp;lt;/code&amp;gt; form, separated by a [[delimiter]], usually an [[ampersand]] (&amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt;), as standardised in the likes of [[Mailto|RFC 6068]] for the &amp;lt;code&amp;gt;mailto:&amp;lt;/code&amp;gt; scheme,&amp;lt;ref name=&amp;quot;rfc6068&amp;quot;&amp;gt;{{cite web |url=https://www.rfc-editor.org/info/rfc6068/ |title=RFC 6068: The &amp;#039;mailto&amp;#039; URI Scheme |author=M. Duerst |author2=L. Masinter |author3=J. Zawinski |date=October 2010}}&amp;lt;/ref&amp;gt;{{rp|2}} and the HTML specifications for [[Form (HTML)|forms]] submitted as GET requests.&amp;lt;ref name=&amp;quot;w3c-recom&amp;quot;/&amp;gt;&amp;lt;ref name=&amp;quot;w3c-recom-2014&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example URL with a single query string parameter:{{quote|1=&amp;lt;syntaxhighlight lang=wikitext&amp;gt;https://example.com/over/there?name=ferret&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
An example URL with multiple query string parameters and a fragment identifier:{{quote|1=&amp;lt;syntaxhighlight lang=wikitext&amp;gt;https://example.com/path/to/page?name=ferret&amp;amp;color=purple#fur&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
An example email link with query string parameters for pre-populating certain fields:{{quote|1=&amp;lt;syntaxhighlight lang=wikitext&amp;gt;mailto:holly@example.com?subject=meeting&amp;amp;cc=assistant@example.com&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Web forms ===&lt;br /&gt;
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 &amp;lt;code&amp;gt;field1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;field2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;field3&amp;lt;/code&amp;gt; is submitted, the content of the fields is encoded as a query string as follows:&lt;br /&gt;
{{quote|1=&amp;lt;code&amp;gt;field1=value1&amp;amp;amp;field2=value2&amp;amp;amp;field3=value3...&amp;lt;/code&amp;gt;}}&lt;br /&gt;
* The query string is composed of a series of field-value pairs.&lt;br /&gt;
* Within each pair, the field name and value are separated by an [[equals sign]], &amp;quot;&amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
* The series of pairs is separated by the [[ampersand]], &amp;quot;&amp;lt;code&amp;gt;&amp;amp;amp;&amp;lt;/code&amp;gt;&amp;quot; ([[semicolons]] &amp;quot;&amp;lt;code&amp;gt;;&amp;lt;/code&amp;gt;&amp;quot; are not recommended by the [[W3C]] anymore, see below).&lt;br /&gt;
&lt;br /&gt;
While there is no definitive standard, most [[web framework]]s allow multiple values to be associated with a single field (e.g. &amp;lt;code&amp;gt;field1=value1&amp;amp;field1=value2&amp;amp;field2=value3&amp;lt;/code&amp;gt;).&amp;lt;ref&amp;gt;{{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}}&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{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}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For each [[Field (computer science)|field]] of the form, the query string contains a pair &amp;lt;code&amp;gt;&amp;lt;var&amp;gt;field&amp;lt;/var&amp;gt;=&amp;lt;var&amp;gt;value&amp;lt;/var&amp;gt;&amp;lt;/code&amp;gt;. 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.&lt;br /&gt;
&lt;br /&gt;
This convention is a [[W3C]] recommendation.&amp;lt;ref name=&amp;quot;w3c-recom&amp;quot;&amp;gt;[https://www.w3.org/TR/html401/interact/forms.html#form-content-type Forms in HTML documents]. W3.org. Retrieved on 2013-09-08.&amp;lt;/ref&amp;gt; In the recommendations of 1999, W3C recommended that all web servers support [[semicolon]] separators in addition to [[ampersand]] separators&amp;lt;ref&amp;gt;[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.&amp;lt;/ref&amp;gt; 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.&amp;lt;ref name=&amp;quot;w3c-recom-2014&amp;quot;&amp;gt;{{cite web | url=https://www.w3.org/TR/2014/REC-html5-20141028/forms.html#url-encoded-form-data | title=4.10 Forms — HTML5 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The form content is only encoded in the URL&amp;#039;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.&amp;lt;ref name=&amp;quot;html5&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Indexed search ===&lt;br /&gt;
Before [[form (HTML)|forms]] were added to HTML, browsers rendered the –{{tag|isindex|open}} element as a single-line text-input control. The text entered into this control was sent to the server as a query string addition to a [[GET (HTTP)|GET]] request for the base URL or another URL specified by the {{code|action}} attribute.&amp;lt;ref&amp;gt;{{cite web |title=&amp;amp;lt;isindex&amp;amp;gt; |url=https://developer.mozilla.org/en-US/docs/Web/HTML/Element/isindex |website=HTML (HyperText Markup Language) |access-date=2015-11-21 |archive-date=2017-10-19 |archive-url=https://web.archive.org/web/20171019030835/https://developer.mozilla.org/en-US/docs/Web/HTML/Element/isindex |url-status=dead }}&amp;lt;/ref&amp;gt; This was intended to allow web servers to use the provided text as query criteria so they could return a list of matching pages.&amp;lt;ref&amp;gt;{{cite web |title=HTML/Elements/isindex |url=https://www.w3.org/wiki/HTML/Elements/isindex |website=W3C Wiki |access-date=2020-03-20 |archive-date=2021-06-22 |archive-url=https://web.archive.org/web/20210622024419/https://www.w3.org/wiki/HTML/Elements/isindex |url-status=dead }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the text input into the indexed search control is submitted, it is encoded as a query string as follows:&lt;br /&gt;
{{quote|1=&amp;lt;code&amp;gt;argument1+argument2+argument3...&amp;lt;/code&amp;gt;}}&lt;br /&gt;
* The query string is composed of a series of arguments by parsing the text into words at the spaces.&lt;br /&gt;
* The series is separated by the [[plus sign]], &amp;#039;&amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Though the {{tag|isindex|open}} element is deprecated and most browsers no longer support or render it, there are still some vestiges of indexed search in existence. For example, this is the source of the special handling of [[plus sign]], &amp;#039;&amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt;&amp;#039; within browser URL percent encoding (which today, with the deprecation of indexed search, is all but redundant with &amp;lt;code&amp;gt;%20&amp;lt;/code&amp;gt;). Also some web servers supporting [[Common Gateway Interface|CGI]] (e.g., [[Apache HTTP Server|Apache]]) will process the query string into command line arguments if it does not contain an [[equals sign]], &amp;#039;&amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt;&amp;#039; (as per section 4.4 of CGI 1.1). Some CGI scripts still depend on and use this historic behavior for URLs embedded in HTML.&lt;br /&gt;
&lt;br /&gt;
== [[URL]] encoding ==&lt;br /&gt;
{{Main|Percent-encoding}}&lt;br /&gt;
&lt;br /&gt;
Some [[Character (computing)|characters]] cannot be part of a URL (for example, the space) and some other characters have a special meaning in a URL: for example, the &amp;lt;span lang=&amp;quot;en&amp;quot;&amp;gt;character&amp;lt;/span&amp;gt; &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; can be used to further specify a subsection (or [[Fragment identifier|fragment]]) of a document. In HTML forms, the character &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt; is used to separate a name from a value. The URI generic syntax uses [[Percent-encoding#Percent-encoding reserved characters|URL encoding]] to deal with this problem, while HTML forms make some additional substitutions rather than applying percent encoding for all such characters. SPACE is encoded as &amp;#039;&amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt;&amp;#039; or &amp;quot;&amp;lt;code&amp;gt;%20&amp;lt;/code&amp;gt;&amp;quot;.&amp;lt;ref name=&amp;quot;w3schools&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[HTML 5]] specifies the following transformation for submitting HTML forms with the &amp;quot;GET&amp;quot; method to a web server. The following is a brief summary of the algorithm:&lt;br /&gt;
* Characters that cannot be converted to the correct charset are replaced with HTML [[numeric character reference]]s&amp;lt;ref name=&amp;quot;html5 urlencoded&amp;quot; /&amp;gt;&lt;br /&gt;
* SPACE is encoded as &amp;#039;&amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt;&amp;#039; or &amp;#039;&amp;lt;code&amp;gt;%20&amp;lt;/code&amp;gt;&amp;#039;&lt;br /&gt;
* Letters (&amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;Z&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt;), numbers (&amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;–&amp;lt;code&amp;gt;9&amp;lt;/code&amp;gt;) and the characters &amp;#039;&amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt;&amp;#039;,&amp;#039;&amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt;&amp;#039;,&amp;#039;&amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&amp;#039; and &amp;#039;&amp;lt;code&amp;gt;_&amp;lt;/code&amp;gt;&amp;#039; are left as-is&lt;br /&gt;
* &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; is encoded by %2B&lt;br /&gt;
* All other characters are encoded as a &amp;lt;code&amp;gt;%HH&amp;lt;/code&amp;gt; [[hexadecimal]] representation with any non-ASCII characters first encoded as [[UTF-8]] (or other specified encoding)&lt;br /&gt;
&lt;br /&gt;
The octet corresponding to the tilde (&amp;quot;&amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt;&amp;quot;) is permitted in query strings by RFC3986 but required to be percent-encoded in HTML forms to &amp;quot;&amp;lt;code&amp;gt;%7E&amp;lt;/code&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The encoding of SPACE as &amp;#039;&amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt;&amp;#039; and the selection of &amp;quot;as-is&amp;quot; characters distinguishes this encoding from RFC 3986.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
As discussed in the [[Hypertext Transfer Protocol|HTTP]] specification, web services have sometimes imposed arbitrary length restrictions on URIs, rejecting requests they deem too long with [[List of HTTP status codes#414|414]] (&amp;#039;&amp;#039;Request-URI Too Long&amp;#039;&amp;#039;) status codes:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Various ad hoc limitations on request-line length are found in practice. It is RECOMMENDED that all HTTP senders and recipients support, at a minimum, request-line lengths of 8000 octets.&amp;lt;ref&amp;gt;[https://tools.ietf.org/html/rfc7230#section-3.1.1 HTTP/1.1 Message Syntax and Routing]. ietf.org. Retrieved on 2014-07-31.&amp;lt;/ref&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A workaround, applicable to HTML forms, is to configure the form to be submitted with the [[POST (HTTP)|POST]] method instead of [[GET (HTTP)|GET]], thus the form data is sent in the HTTP request separated from the URI, rather than using the URI query string as in the GET method. Length limits on HTTP request bodies are typically much larger than those imposed on URI length.{{cite needed|date=September 2026}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
{{div-col}}&lt;br /&gt;
* [[Clean URL]]&lt;br /&gt;
* [[Common Gateway Interface]] (CGI)&lt;br /&gt;
* [[HTTP cookie]]&lt;br /&gt;
* [[HyperText Transfer Protocol]] (HTTP)&lt;br /&gt;
* [[Semantic URL]]s&lt;br /&gt;
* [[URI fragment]]&lt;br /&gt;
* [[URI normalization]]&lt;br /&gt;
* [[URI scheme]]&lt;br /&gt;
* [[UTM parameters]]&lt;br /&gt;
{{div-col-end}}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{Reflist | refs=&lt;br /&gt;
&amp;lt;ref name=&amp;quot;html5&amp;quot;&amp;gt;[https://www.w3.org/TR/html52/sec-forms.html#form-submission-algorithm], HTML5.2, W3C recommendation, 14 December 2017&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;w3schools&amp;quot;&amp;gt;{{cite web|title=HTML URL Encoding Reference|url=https://www.w3schools.com/tags/ref_urlencode.asp|publisher=W3Schools|access-date=May 1, 2013}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;html5 urlencoded&amp;quot;&amp;gt;The [https://www.w3.org/TR/html52/sec-forms.html#application-x-www-form-urlencoded-encoding-algorithm &amp;#039;&amp;#039;application/x-www-form-urlencoded&amp;#039;&amp;#039; encoding algorithm], HTML5.2, W3C recommendation, 14 December 2017&amp;lt;/ref&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:URL]]&lt;br /&gt;
[[Category:String (computer science)]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Zahrazamedahmedi</name></author>
	</entry>
</feed>