Max payload size for http request and response, ip

2019-01-29 06:20发布

问题:

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/



标签: iphone http