({{, (RefLink[URLQueryDecode, paclet:ref/URLQueryDecode])["string"] 
decodes a URL-style query string into a list of key-value rules. }})

OpenersNotesSection(Spacer1)Details and Options

The keys and values in the list of rules returned by (RefLink[URLQueryDecode, paclet:ref/URLQueryDecode]) are given as strings.

The URL-style query string is taken to be percent-encoded.

(RefLink[URLQueryDecode, paclet:ref/URLQueryDecode]) has option (RefLink[CharacterEncoding, paclet:ref/CharacterEncoding]), giving the encoding to assume for a character in the query string. The default is "UTF-8".

(RefLink[URLQueryDecode, paclet:ref/URLQueryDecode])[(RefLink[URL, paclet:ref/URL])["string"]] is also supported.

OpenersPrimaryExamplesSection(Spacer1)Examples  (7)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Decode a query string:

URLQueryDecode["name=smiley&symbol=%3A%29"]

(RefLink[URLQueryDecode, paclet:ref/URLQueryDecode]) automatically threads over lists:

URLQueryDecode[{"p1=a%2Bb","p2=a%2Ab"}]

OpenersExampleSection1(Spacer1)Scope  (1)

A (RefLink[URL, paclet:ref/URL]) wrapper is stripped from an input:

URLQueryDecode[URL["http://www.wolfram.com/?i=1"]]

OpenersExampleSection2(Spacer1)Options  (3)

OpenersExampleSubsection0(Spacer1)CharacterEncoding  (1)

Decode a percent-encoded string using specified encoding:

URLQueryDecode["university=E%9Atv%9As+Lor%87nd+University", CharacterEncoding->"MacintoshRoman"]

OpenersExampleSubsection1(Spacer1)SortQueries  (1)

Sort query parameters by using "SortQueries":

URLQueryDecode["z=1&a=2&c=4", "SortQueries" -> True]

URLQueryDecode["z=1&a=2&c=4"]

OpenersExampleSubsection2(Spacer1)RemoveEmptyQueries  (1)

Remove empty parameters by using "RemoveEmptyQueries":

URLQueryDecode["z=1&a&c=4&z=", "RemoveEmptyQueries" -> True]

URLQueryDecode["z=1&a&c=4&z="]

OpenersExampleSection3(Spacer1)Applications  (1)

Joining multiple query strings:

URLQueryEncode[URLQueryDecode[{"zed=4&anna=1", {"sara=1&", "paul=5"}}]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[URLQueryEncode, paclet:ref/URLQueryEncode])  ▪  (RefLink[URLEncode, paclet:ref/URLEncode])  ▪  (RefLink[URLDecode, paclet:ref/URLDecode])  ▪  (RefLink[URLBuild, paclet:ref/URLBuild])  ▪  (RefLink[URLParse, paclet:ref/URLParse])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[URL Manipulation, paclet:guide/URLManipulation])}})}})