美文网首页
Charles抓包map local后出现"failed: un

Charles抓包map local后出现"failed: un

作者: HotPotCat | 来源:发表于2020-11-12 15:31 被阅读0次

Charles抓包map local后,local数据返回正常,app内部报网络错误,数据类型错误。查看具体信息如下:

Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/plain" UserInfo={NSLocalizedDescription=Request failed: unacceptable content-type: text/plain, NSErrorFailingURLKey=https://***url, com.alamofire.serialization.response.error.data=<*** 30303022 2c0a2020 20202020 22637265 61746554 696d6522 203a2031 36303438 38373134 38343634 0a202020 207d0a20 205d0a7d***>, com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x2835cd9a0> { URL: *** } { Status Code: 200, Headers {
    Connection =     (
        "keep-alive"
    );
    "Content-Length" =     (
        456
    );
    "Content-Type" =     (
        "text/plain"
    );
    "X-Charles-Map-Local" =     (
        "/Users/zaizai/Desktop/findAll"
    );
} }}

两种解决方案:
1.Charles修改返回值数据类型。
2.app内部修改能接受的数据类型。
由于只是Charles抓包map local数据, 所以采用第一种就好。
Charles-tools-rewrite


image.png
image.png

相关文章

网友评论

      本文标题:Charles抓包map local后出现"failed: un

      本文链接:https://www.haomeiwen.com/subject/hjdpbktx.html