如何使用POST方法发送大数据? [英] How to send large data using POST method?

查看:396
本文介绍了如何使用POST方法发送大数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用POST方法发送大量数据?



我听说post方法的默认值是8M,现在如果超过这个大小,该怎么办?如何发送一个纯文本到服务器?

解决方案

David 的一个很好的答案:


请求(GET和POST)的URL部分可以受
浏览器和服务器的限制 - 通常是安全大小为2KB,因为有
几乎没有浏览器或服务器使用较小的限制。



请求的正文(POST)通常受限于服务器以
字节大小为基础,以防止一种DoS攻击(注意
这意味着字符转义可以增加主体的字节大小)。
最常见的服务器设置为10MB,尽管所有流行的服务器
都允许通过设置文件或面板来增加或减少此设置。



*旧手机或其他小型设备浏览器存在一些例外情况 - 在这种情况下,它更多的是堆空间预留
用于设备上的此功能,然后是其他任何功能。




什么是请求的大小限制?



注意:URL中的2MB数据表示2097152一个请求中的字符。



另外,如果您想发送更多数据,您可以使用 multipal ajax请求

How do you send large amount of data using POST method?

I heard that post method default is 8M now what if you exceed that size? How would you send a plain text to the server?

解决方案

A good answer by David:

The url portion of a request (GET and POST) can be limited by both the browser and the server - generally the safe size is 2KB as there are almost no browsers or servers that use a smaller limit.

The body of a request (POST) is normally* limited by the server on a byte size basis in order to prevent a type of DoS attack (note that this means character escaping can increase the byte size of the body). The most common server setting is 10MB, though all popular servers allow this to be increased or decreased via a setting file or panel.

*Some exceptions exist with older cell phone or other small device browsers - in those cases it is more a function of heap space reserved for this purpose on the device then anything else.

What is the size limit of a post request?

NOTE: 2MB of data by URL means 2097152 Char in one request.

Also if you want to send more data you can use multipal ajax request

这篇关于如何使用POST方法发送大数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆