当返回值不是JSON格式时,需要添加一行如下代码:
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
否则会报如下错误:
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.}
网友评论