zoukankan      html  css  js  c++  java
  • Are query string keys case sensitive?浏览器种输入url附带的参数是否区分大小写

     

    Are query string keys case sensitive?

    @gbjbaanb's answer is incorrect: The RFCs only specify the allowed character set for the query string. Like the path and fragment components of the URI, the query URI component only has meaning only to the authority providing the resource.

    It is entirely up to that authority on whether this stuff is case-sensitive or not.

    In the case of C# and IIS, the backing store for the parsed query string in the HttpRequest object is a System.Collections.Specialized.NameValueCollection which happens to be case-insensitive (by default).

    Since that class offers other constructors allow different equality comparers to be provided, there is absolutely nothing to prevent an implementation from making it case-sensitive.

    Further, since the page itself (and the client-side javascript) have access to the raw URI, they are free to do whatever they want with it.

    If the query string is built as a result of an HTML form submission, the keys (names) come from the value of the form controls name attribute, which the HTML specs say is case-sensitive. But as near as I know, nobody really does that.

    So, at the end of the day, you have to know what the request handler is expecting in your query string. It might (or it might not) be case-sensitive.

  • 相关阅读:
    dubbo
    常见线程池
    面试之葵花宝典
    Java线程池
    DB2分页
    平凡
    自由职业一时爽,一直自由一直爽
    弱水三千,只取一瓢。
    没病到一定程度,你千万别去。
    一个转身一个轮回
  • 原文地址:https://www.cnblogs.com/chucklu/p/11686000.html
Copyright © 2011-2022 走看看