如何使用 Alamofire 在 iOS13 的 GET 请求中发送 httpBody?
How to send httpBody in GET request with iOS13 using Alamofire?
问题是因为 iOS13 现在不允许在 GET 请求中发送 httpBody。我正在使用 Alamofire,我无法访问的后端有很多端点需要 GET 请求和一个请求中的 httpBody(请不要写它不合适,我知道)。我仍然希望我的应用程序能够交付并运行。任何想法如何允许在 GET 请求中发送 httpBody?提前致谢!
此错误已添加到 Alamofire 5 中以匹配底层 URLSession
框架的行为,该框架已更新为在 2019 操作系统中为带有正文数据的 GET
请求产生错误( iOS13、macOS 10.15 等)。来自 Apple 的发行说明:
All URLSessionTask instances with a GET HTTP method which contain a body will now produce the error NSURLErrorDataLengthExceedsMaximum. (46025234)
如果你真的想避免 Alamofire 错误,你可以继续使用 Alamofire 4,但你仍然会在 2019 操作系统上遇到 URLSession
错误。
问题是因为 iOS13 现在不允许在 GET 请求中发送 httpBody。我正在使用 Alamofire,我无法访问的后端有很多端点需要 GET 请求和一个请求中的 httpBody(请不要写它不合适,我知道)。我仍然希望我的应用程序能够交付并运行。任何想法如何允许在 GET 请求中发送 httpBody?提前致谢!
此错误已添加到 Alamofire 5 中以匹配底层 URLSession
框架的行为,该框架已更新为在 2019 操作系统中为带有正文数据的 GET
请求产生错误( iOS13、macOS 10.15 等)。来自 Apple 的发行说明:
All URLSessionTask instances with a GET HTTP method which contain a body will now produce the error NSURLErrorDataLengthExceedsMaximum. (46025234)
如果你真的想避免 Alamofire 错误,你可以继续使用 Alamofire 4,但你仍然会在 2019 操作系统上遇到 URLSession
错误。