开发者

Does URL querystring encoding preserve order for multi-valued keys?

http://www.example.com?a=1&a=2 has a valid form-urlencoded querystring and has two values (1 and 2) for the key a.

  1. Is there any spec or standard for URL consumers guaranteeing ordering (开发者_JS百科or lack thereof) of parsed values?
  2. Do common implementations (Django's QueryDict, dojo's queryToObject, PHP, etc) preserve ordering?


OK, this question: Authoritative position of duplicate HTTP GET query keys, suggests there is no such standard and that order should not be considered reliable.

My experience has been that latest WebKit encodes identically named form fields in DOM order and that Django's QueryDict preserves that order. Shaky ground at best.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜