NSURL max length?

喜夏-厌秋 提交于 2019-12-06 16:07:40

NSURL can easily handle 20Kb.

The implementation limitation is around 2Gb (INT_MAX) for the URL string. The limitations you'll run into first with large URLs are memory and time. You'll run out of memory for the allocations at some point (For 32-bit executables, the limitation is a little over 1.1GB when your process runs out of address space; for 64-bit executables, the limitation depends on your system's available VM swap space). Creating very large URLs will take a lot of time to create and parse.

Did you get a 414 (request too long) on your request? There is no formal limit, but systems have ad hoc limits which may be as low as 8k.

You should use a POST instead of putting all the data in the URL.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!