zoukankan      html  css  js  c++  java
  • 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];

     

  • 相关阅读:
    JS 原型模式 工厂模式 构造函数的区别
    JS 深入1
    理解DOM的一个例子
    Fuzzing参数
    神经网络相关知识和概念整理
    [转载] 系统、模型和仿真
    frp内网穿透,从外网访问内网资源
    常用软件配置
    141. 环形链表
    501. 二叉搜索树中的众数
  • 原文地址:https://www.cnblogs.com/code-Officer/p/6248194.html
Copyright © 2011-2022 走看看