如何解决NSURLErrorDomain:无法快速解码原始数据

时间:2019-05-23 10:03:09

标签: ios swift alamofire gzip objectmapper

我正在尝试将请求发送到服务器。我得到的状态码为200,内容长度为90956,结果返回

"adb shell am start -W -a android.intent.action.VIEW -d "example://test"

我试图将参数编码值更改为FAILURE: Error Domain=NSURLErrorDomain Code=-1015 "cannot decode raw data" in swift 4 ,但是什么也没发生。

JSONEncoding.Default

实际

AF.request(url, method: .get, parameters: params, headers:headers)
        .responseString { response in
            print("Request :- " , response.request as Any)
            print("Response error :- ", response.error as Any)
            print("Response :- ", response.response as Any)
    }

预期

Data None
Network Duration: 0.06679093837738037s Duration: 2.5987625122070312e-05s
Result: FAILURE: Error Domain=NSURLErrorDomain Code=-1015 "cannot decode raw data"

0 个答案:

没有答案