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

最新文章

  1. eclipse开发servlet,HttpServletRequest报红叉解决方案
  2. s3c2440笔记1(启动)
  3. Activity启动清空原任务栈
  4. js保留n位小数
  5. 利用Web服务器网络打洞
  6. linux xargs参数
  7. JavaScript构建(编绎)系统大比拼:Grunt vs. Gulp vs. NPM
  8. 为什么选择Premium Fabric Shanghai
  9. Tomcat会话保持之session server
  10. Python:re中的group方法简介
  11. MAC终端神器iterm2——告别黑白
  12. nacos 使用记
  13. Unity3D 4.x编辑器操作技巧
  14. 用Python实现数据结构之链表
  15. Python笔记:用for循环删除列表中的元素
  16. 安装nodejs
  17. C# 将MDI窗口嵌入普通窗口
  18. geoserver 文件系统
  19. Ibatis基础知识:#与$的差别
  20. Amazon - removed your selling privileges and placed a temporary hold on any funds - 1

热门文章

  1. greasemonkey修改网页内指定函数
  2. h5 的 audio 标签知识点
  3. Jenkins进阶-远程构建任务(4)
  4. sqlserver 同义名的使用
  5. POJ1135 Domino Effect
  6. VT-x is not available. (VERR_VMX_NO_VMX) on windows 8
  7. hadoop技术入门学习之发行版选择
  8. 【python】实例-把两个无规则的序列连接成一个序列,并删除重复的元素,新序列按照升序排序
  9. 知识点查缺补漏贴03:单机最大进程数,线程数和Socket连接数
  10. jsoncpp解析拼装数组