Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Query string: Can a query string contain a URL that also contains query strings?

Tags:

html

asp.net

iis

Example:

http://foo.com/generatepdf.aspx?u=http://foo.com/somepage.aspx?color=blue&size=15

I added the iis tag because I am guessing it also depends on what server technology you use?

like image 742
Pickels Avatar asked Nov 22 '10 18:11

Pickels


People also ask

Does URL include query string?

A query string is a part of a uniform resource locator (URL) that assigns values to specified parameters.

Can a URL have multiple query strings?

In a URL, the query starts with a question mark, with multiple query parameters separated by ampersands ("&"). URLs with more than 3 parameters could be considered highly dynamic, for example, faceted search URLs that include multiple filters and sorts.

Can query string contain?

No, but you can encode the url and decode it later.


1 Answers

The server technology shouldn't make a difference.

When you pass a value to a query string you need to url encode the name/value pair. If you want to pass in a value that contains a special character such as a question mark (?) you'll just need to encode that character as %3F. If you then needed to recursively pass another query string to the encoded url, you'll need to double/triple/etc encode the url resulting in the original ? turning into %253F, %25253F, etc.

like image 105
zzzzBov Avatar answered Oct 19 '22 05:10

zzzzBov