今天用AFNetworking做了個接口請求報如下錯誤:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/css" UserInfo={NSLocalizedDescription=Request failed: unacceptable content-type: text/css, body=[{"RESULT":"1"}], NSErrorFailingURLKey=http://XXXXXX打碼XXXXXX, statusCode=200, com.alamofire.serialization.response.error.data=<5b7b2252 4553554c 54223a22 31227d5d>, com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x281af40e0> { URL: http://XXXXXX打碼XXXXXX } { Status Code: 200, Headers {
? ? "Content-Length" =? ? (
? ? ? ? 16
? ? );
? ? "Content-Type" =? ? (
? ? ? ? "text/css;charset=UTF-8"
? ? );
? ? Date =? ? (
? ? ? ? "Tue, 24 Dec 2019 15:27:57 GMT"
? ? );
? ? Server =? ? (
? ? ? ? "Apache-Coyote/1.1"
? ? );
? ? "Set-Cookie" =? ? (
? ? ? ? "JSESSIONID=TeFZTu7O1WPvLa-6CVZZtvl7.undefined; Path=/AcuLife"
? ? );
} }}<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
根據(jù)提示,表示不識別 'text/css'類型的數(shù)據(jù),添加如下設(shè)置即可
