【问题标题】:How many bytes can I send via POST / GET?我可以通过 POST / GET 发送多少字节?
【发布时间】:2013-07-06 10:47:44
【问题描述】:
我有一个简单的 Android 应用,它从相机拍摄照片,然后将图像转换为 Base64 字符。然后我把这个String发给一个webservice,webservices把这个Base64转换成二进制文件,最后把图片保存到服务器上。
但是,它适用于小图片,但我想这不适用于视频或高分辨率图像。
你们知道极限在哪里吗?我想这与您可以通过请求中的参数发送多少个字符直接相关,但找不到任何相关信息。
【问题讨论】:
标签:
php
android
web-services
post
get
【解决方案1】:
如果您阅读以下标准,您会发现不应该有限制,但网络服务器可能有(引用自此处http 1.1)
The HTTP protocol does not place any a priori limit on the length of
a URI. Servers MUST be able to handle the URI of any resource they
serve, and SHOULD be able to handle URIs of unbounded length if they
provide GET-based forms that could generate such URIs. A server
SHOULD return 414 (Request-URI Too Long) status if a URI is longer
than the server can handle
据我所知,Apache 的 GET 请求长度限制为 4000 个字符
对于 POST,不应该有任何限制