gpt4 book ai didi

ios - URLSession.shared 请求崩溃 Swift 3

转载 作者:可可西里 更新时间:2023-11-01 02:14:38 29 4
gpt4 key购买 nike

为什么这个东西崩溃就是想不通

        var request = URLRequest(url: URL(string: url)! )
request.httpMethod = "POST"
request.httpBody = try! JSONSerialization.data(withJSONObject: params, options: [])
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

let task = URLSession.shared.dataTask(with: request, completionHandler: {data, response, error -> Void in
guard let responceSafe = response else {
completion([:], 0)
return
}
/*some not related code*/
}

这里的错误日志看起来多么奇怪:

Assertion failed: (isForProxy(authConfig.getConnectionType())), function updateWithResponse, file /BuildRoot/Library/Caches/com.apple.xbs/Sources/CFNetwork/CFNetwork-808.0.2/HTTP/HTTPAuthentication/AuthenticationHelpers.cpp, line 1168.

最佳答案

对我来说,是 InMobi 造成了麻烦。 InMobi 是第三个 SDK。当我删除有关它的代码时,崩溃就消失了!

关于ios - URLSession.shared 请求崩溃 Swift 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39500308/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com