AFNetworking 与 gbk 编码格式后台数据的使用

 仅针,后台数据为GBK编码时的AFNetWorking 使用情况:  

1. Request failed: unacceptable content-type: text/html     solution:

     manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];

 

  2,Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}
  说明: data数据不符合json格式,可能是,其中输出了其他的信息(有可能是错误信息),总之,不是jsonserialize 能够解析的格式!

 solution:查找修个数据。检查在哪里输出了其他的非json信息。

     3, Error Domain=NSCocoaErrorDomain Code=3840 "Unable to convert data to string around character 95." UserInfo={NSDebugDescription=Unable to convert data to string around character 95.}

      solution:

      manager.responseSerializer = [AFHTTPResponseSerializer serializer];

 

posted @ 2017-01-04 12:33  wangwei_Carry  阅读(576)  评论(0编辑  收藏  举报