传回来的json是text/html,是不可接受格式,那么就是说:
1、让AFNetworking接受传回值是text/html格式;
manager.responseSerializer.acceptableContentTypes = [manager.responseSerializer.acceptableContentTypes setByAddingObject:@"text/html"];
2、把text/html这种json序列化(serializer)成二进制格式(NSData),然后再解析出来,就是用NSData当中间层。
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
拿到responseObject后,如果外层是字典:
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableContainers error:nil];