我正在使用最新的 alamofire 版本 5.2.1 来使 WEB API 调用它与所有 api 完美配合但是当我为国家列表调用 api 时它在 URL Session Delegate 类中崩溃
open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
eventMonitor?.urlSession(session, dataTask: dataTask, didReceive: data)
if let request = request(for: dataTask, as: DataRequest.self) {
request.didReceive(data: data)
} else if let request = request(for: dataTask, as: DataStreamRequest.self) { //Crash at this line
request.didReceive(data: data)
} else {
assertionFailure("dataTask did not find DataRequest or DataStreamRequest in didReceive")
return
}
}
相同的请求与正常的 url 会话完美配合,只有邮递员 alamofire 无法处理我附加屏幕截图以获取更多详细信息的响应。
响应包含 2000 行 json,但我认为这不是问题