• http get 方式参数的长度限制<转>


    http get 方式参数的长度限制

    这个问题一直以来似乎是被N多人误解,其实Http Get方法提交的数据大小长度并没有限制,而是IE浏览器本身对地址栏URL长度有最大长度限制:2048个字符。

    当您从 WinInet 应用程序到 Web 服务器发送一个长的查询字符串时,查询字符串可能会被截断。

    出现此问题是由于中 WinInet,定义 Wininet.h 文件中,如下所示的 URL 的长度限制:

    #define INTERNET_MAX_PATH_LENGTH        2048  
    #define INTERNET_MAX_SCHEME_LENGTH      32          // longest protocol name length  
    #define INTERNET_MAX_URL_LENGTH         (INTERNET_MAX_SCHEME_LENGTH + sizeof("://") + INTERNET_MAX_PATH_LENGTH)  

    此行为是设计使然。

    注意: 因为 Internet Explorer 和 Internet 传输的控制也使用 WinInet,可能会出现相同的问题。

    若要解决此问题,使用 HTTP POST 方法。

    http://support.microsoft.com/kb/208427/zh-cn

    Microsoft Internet Explorer has a maximum uniform resource locator (URL) length of 2,083 characters. Internet Explorer also has a maximum path length of 2,048 characters. This limit applies to both POST request and GET request URLs. ‘>以下附上微软官方的一段说明:

    Microsoft Internet Explorer has a maximum uniform resource locator (URL) length of 2,083 characters. Internet Explorer also has a maximum path length of 2,048 characters. This limit applies to both POST request and GET request URLs. ‘>Microsoft Internet Explorer has a maximum uniform resource locator (URL) length of 2,083 characters. Internet Explorer also has a maximum path length of 2,048 characters. This limit applies to both POST request and GET request URLs.

    If you are using the GET method, you are limited to a maximum of 2,048 characters, minus the number of characters in the actual path.

    However, the POST method is not limited by the size of the URL for submitting name/value pairs. These pairs are transferred in the header and not in the URL. ‘>However, the POST method is not limited by the size of the URL for submitting name/value pairs. These pairs are transferred in the header and not in the URL.

    RFC 2616, “Hypertext Transfer Protocol — HTTP/1.1,” does not specify any requirement for URL length.

    注:本文转载自:http://www.linbuluo.com/?p=5

  • 相关阅读:
    由后序遍历序列和中序遍历序列确定二叉树
    由先序遍历序列和中序遍历序列确定二叉树
    EBR-TLV数据格式
    埃利斯(A.Ellis)ABCDE情绪管理理论
    马斯洛需求层次理论
    【Linux命令】find命令
    Windows核心编程——动态库和静态库
    C++Socket编程—socket网络模型之事件选择模型模型
    C++Socket编程—socket网络模型之异步选择模型
    C++Socket编程—socket网络模型之select模型
  • 原文地址:https://www.cnblogs.com/wainiwann/p/8252666.html
Copyright © 2020-2023  润新知