Max payload size for http request and response, iphone
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/
精彩评论