The part of a URL after the ? (question mark), containing parameter=value pairs separated by & (ampersand). In a request made to a web application at a particular URL, the parameter+value data in the query string is parsed/consumed by the web application on the backend that receives the request.
Questions tagged [query-string]
5108 questions
231
votes
1 answer
How to escape hash character in URL
How can I escape the # hash sign (sometimes known as number sign or pound sign) sent in the query string of a URL?

Muhammad Hewedy
- 29,102
- 44
- 127
- 219
220
votes
8 answers
Append values to query string
I have set of URLs similar to the ones below in a list
http://somesite.example/backup/lol.php?id=1&server=4&location=us
http://somesite.example/news.php?article=1&lang=en
I have managed to get the query strings using the following code:
myurl =…

DriverBoy
- 3,047
- 3
- 19
- 21
204
votes
9 answers
Modifying a query string without reloading the page
I am creating a photo gallery, and would like to be able to change the query string and title when the photos are browsed.
The behavior I am looking for is often seen with some implementations of continuous/infinite page, where while you scroll down…

Sonic Soul
- 23,855
- 37
- 130
- 196
203
votes
9 answers
Is a url query parameter valid if it has no value?
Is a url like http://example.com/foo?bar valid?
I'm looking for a link to something official that says one way or the other. A simple yes/no answer or anecdotal evidence won't cut it.

Conley Owens
- 8,691
- 5
- 30
- 43
196
votes
4 answers
How to send JSON instead of a query string with $.ajax?
Can someone explain in an easy way how to make jQuery send actual JSON instead of a query string?
$.ajax({
url : url,
dataType : 'json', // I was pretty sure this would do the trick
data : data,
type : 'POST',
…

Redsandro
- 11,060
- 13
- 76
- 106
195
votes
6 answers
Node.js: Difference between req.query[] and req.params
Is there a difference between obtaining QUERY_STRING arguments via req.query[myParam] and req.params.myParam? If so, when should I use which?
user1598019
193
votes
31 answers
How can I delete a query string parameter in JavaScript?
Is there better way to delete a parameter from a query string in a URL string in standard JavaScript other than by using a regular expression?
Here's what I've come up with so far which seems to work in my tests, but I don't like to reinvent…

Matthew Lock
- 13,144
- 12
- 92
- 130
191
votes
10 answers
Get query string parameters url values with jQuery / Javascript (querystring)
Anyone know of a good way to write a jQuery extension to handle query string parameters? I basically want to extend the jQuery magic ($) function so I can do something like this:
$('?search').val();
Which would give me the value "test" in the…

TroySteven
- 4,885
- 4
- 32
- 50
190
votes
19 answers
How to parse a query string into a NameValueCollection in .NET
I would like to parse a string such as p1=6&p2=7&p3=8 into a NameValueCollection.
What is the most elegant way of doing this when you don't have access to the Page.Request object?

Nathan Smith
- 36,807
- 6
- 28
- 25
185
votes
19 answers
How to obtain the query string from the current URL with JavaScript?
I have URL like this:
http://localhost/PMApp/temp.htm?ProjectID=462
What I need to do is to get the details after the ? sign (query string) - that is ProjectID=462. How can I get that using JavaScript?
What I've done so far is this:
var url =…

AbdulAziz
- 5,868
- 14
- 56
- 77
166
votes
10 answers
How to configure the web.config to allow requests of any length
I am building a site in which i would like to create a file client side from the value of a textarea element.
I have the code in place to do this, but i am getting this error
HTTP Error 404.15 - Not Found The request filtering module is
…

some_bloody_fool
- 4,605
- 14
- 37
- 46
163
votes
13 answers
Sharing a URL with a query string on Twitter
I'm trying to put a Twitter share link in an email. Because this is in an email I can't rely on JavaScript, and have to use the "Build Your Own" Tweet button.
For example, sharing a link to Google:

haydenmuhl
- 5,998
- 7
- 27
- 32
162
votes
6 answers
In Go's http package, how do I get the query string on a POST request?
I'm using the httppackage from Go to deal with POST request. How can I access and parse the content of the query string from the Requestobject ? I can't find the answer from the official documentation.

Fabien
- 12,486
- 9
- 44
- 62
159
votes
4 answers
Serialize object to query string in JavaScript/jQuery
I'm trying to find information on how to serialize an object to query string format, but all my searches are drowning in results on how to go the other way (string/form/whatever to JSON).
I have
{ one: 'first', two: 'second' }
and I…

Tomas Aschan
- 58,548
- 56
- 243
- 402
158
votes
9 answers
URL query parameters to dict python
Is there a way to parse a URL (with some python library) and return a python dictionary with the keys and values of a query parameters part of the URL?
For example:
url = "http://www.example.org/default.html?ct=32&op=92&item=98"
expected…

Leonardo Andrade
- 2,508
- 2
- 18
- 24