iphone的最大有效载荷大小为http请求和响应 [英] Max payload size for http request and response, iphone
问题描述
iphone中http请求的有效负载大小是否有限制?我需要将图像上传到服务器,因此将作为http请求发送图像的NSData。该有效载荷是否有任何限制。同样,对于respose还有任何限制吗?
我知道的大小没有限制上传。
您将遇到的限制是iPhone应用程序在不使用wifi时只能使用如此多的带宽(例如,如果您在蜂窝网络上)。 / p>
如果处于边缘或3g,您只能以大约1 mb / min的速度移动数据,否则Apple将拒绝该应用程序。我一般都听说这个限制是针对下载的,但我怀疑上传会有相同的限制,你也会在下拉图片时遇到这个限制。
相反除了自己写这个,有一个伟大的lib处理带附件的http请求(不,我不是作者),并且还跟踪所有带宽使用,如果你在蜂窝网络上可以自动节流:
http://allseeing-i.com/ASIHTTPRequest/
Is there any limits for the payload size of an http request in iphone? I'm requiring to upload images to the server, so will be sending NSData of the image as an http request. Is there any limit in that payload. Similarly, will there be any limits for the respose also?
There is no limit that I know of as far as size of the upload.
The limit you will run into is that iPhone apps can only use so much bandwidth when not on wifi (e.g. if you are on the cellular network).
If on edge or 3g, you can only move data at about 1 mb/min, otherwise Apple will reject the app. I have generally heard this limit being imposed on downloads, but I suspect uploads would have the same limit, and you will also run into this as you pull down images.
Rather than write this yourself, there is a great lib out there that handles http requests with attachments (no I am not the author), and also keeps track of all bandwidth use and can throttle is automatically if you are on the cellular network:
http://allseeing-i.com/ASIHTTPRequest/
这篇关于iphone的最大有效载荷大小为http请求和响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!