2
爲什麼這件事情只是崩潰想不通URLSession.shared要求轟然斯威夫特3
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.