Just asking this question and getting some feedback from others, I also suggested digging further.
The Wikipedia Query String in the Web Forms section reads:
- Each pair of field values ββis separated by an equal sign. An equal sign may be omitted if the value is an empty string.
The query string is defined in section 3.4 of RFC 3986 , but in fact key-value pairs are not part of the standard, and are briefly mentioned:
However, since query components are often used to transfer identifying information in the form of a key-value pair and one frequently used value is a link to another URI, it is sometimes better to use convenience to avoid percent encoding of these characters.
As you can see, nothing indicates the presence or absence of values ββfor the keys.
As for jQuery, two error messages / feature requests about this behavior have been reported over the past 15 months:
Various suggestions have been made to convert param: null
and param: undefined
to param
or param=
.
At the end, a fix was included for the next version of jQuery, 1.8, which converts both null
and undefined
to param=
- an empty string.
This makes some sense, of course, but for the MediaWiki case, which was not mentioned in the error reports / function requests, this does not help at all:
http://en.wikipedia.org/w/api.php?action=query&titles=Main%20page&redirects=
returns
<?xml version="1.0"?> <api> <query> <redirects> <r from="Main page" to="Main Page" /> </redirects> <pages> <page pageid="15580374" ns="0" title="Main Page" /> </pages> </query> </api>
Summarizing:
The standards do not indicate what should be done here, leaving it to implementations. The MediaWiki API did one thing: jQuery initially missed it, and then, when it was specified, did another. It seems that both sides do not know each other.
The gap in the specification led to incompatible interpretations ... but they are easy to get around.