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

http get 方式参数的长度限制<转>的更多相关文章

  1. react native 网络get请求方式参数不可为undefined或null

    react native 网络get请求方式参数不可为undefined(为空的话默认变为)或null 错误写法: export function addToCartAction(isRefreshi ...

  2. 项目总结——SqlParameter的参数设置长度(size属性)

    看到很多朋友在实例化SqlParameter时,通常都没有指定参数的长度就直接给参数赋值了.就像下面的写法: new SqlParameter("@address", SqlDbT ...

  3. css3种引入方式,样式与长度颜色,常用样式,css选择器

    # CSS三种引入方式 ## 一.三种方式的书写规范 #### 1.行间式 ```html<div style="width: 100px; height: 100px; backgr ...

  4. GET请求的请求参数最大长度

    在HTTP规范RFC-2616中有这样一段描述: The HTTP protocol does not place any a priori limit on the length of a URI. ...

  5. ADG日志传输方式参数log_archive_dest_n详解

    主库的日志发送是由log_archive_dest_n参数设置(注意:同时还有一个和它相对应的开关参数log_archive_dest_state_n,用于指定该参数是否有效),下面简单介绍下该参数各 ...

  6. 信号板拼包:数组方式(bug长度只是截短,并未清空,若之后拷贝数据长度小于之前数据长度,老数据会接在后面)

    class SignalobardMsgReadHandler : public SessionVectChar::ReadHandler{public:  SignalobardMsgReadHan ...

  7. 修改Tomcat可支持get传参方式的url长度,get形式

    maxHttpHeaderSize="8192"加在 <Connector port="8081" maxHttpHeaderSize="314 ...

  8. Java 不定长度参数

    在调用某个方法时,若是方法的参数个数事先无法确定该如何处理?例如System.out.printf()方法中并没有办法事先决定要给的参数个数,像是: ? 1 2 3 System.out.printf ...

  9. C++数组参数应用方式探讨(转)

    对于经验丰富的编程人员来说,C++编程语言应该是他们经常使用于程序开发的一种实用性语言.那么,在C++中,C++数组参数永远不会按值传递.它是传递第一个元素(准确地说是第0个)的指针. 例如,如下声明 ...

随机推荐

  1. 六、物理数据模型(PDM逆向工程)

      物理数据模型PDM 物理数据模型(Physical Data Model,PDM):在数据库的逻辑结构设计好之后,就需要完成其物理设计,PDM就是为实现这一目的而设计的. 物理数据模型是以常用的D ...

  2. asterisk channel driver dev ref

    入口函数load_module    load_config    ast_channel_register console_tech    ast_cli_register_multiple     ...

  3. [转]Spring IOC详解

    Spring框架的Spring的IoC(控制反转) .DI(依赖注入)这两个概念,对于初学Spring的人来说,总觉得IoC .DI这两个概念是模糊不清的,是很难理解的,今天和大家分享网上的一些技术大 ...

  4. spring cloud 知识点

    优秀的介绍资料: 资料 地址 spring cloud 中文网 https://springcloud.cc/ spring cloud 介绍 https://www.jianshu.com/p/74 ...

  5. tomcat和servlet关系

    https://blog.csdn.net/weixin_30531261/article/details/78574410 图不错:https://www.cnblogs.com/fengli999 ...

  6. chrome 45以上flash被拦截的一种可能解决方案

    chrome 45以上不自动播放"非必要"flash的一种可能解决方案chrome 45以上flash被拦截的一种可能解决方案 问题 1.chrome 45以上(包含45)版本默认 ...

  7. go get中的...

    go get命令是go自带的包下载工具. 如果配置了GOPATH,下载的文件放置于GOPATH/src下面 例如 $ go get github.com/garyburd/redigo/redis $ ...

  8. 微信小程序开发(request请求后台获取不到data)

    1微信的request的post请求后台获取不到data(当初这个问题纠结了好久好久),原因是post传递的data是json格式而不是key,value的格式,所以获取不到相应的data就是post ...

  9. Fatal error: Unable to find local grunt.

    https://stackoverflow.com/questions/15483735/fatal-error-unable-to-find-local-grunt-when-running-gru ...

  10. spring Annotation based configuration

    spring 注解相关 https://docs.spring.io/spring/docs/3.0.0.M3/reference/html/ch04s11.html