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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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/