AFNetworking 3.0 获取body

2017-03-21  本文已影响76人  LD_X

新增个人想法:
1、尽量使用postman
2、青花瓷
why
根本找不到
比如下面接口状态200


粘贴图片.png

以上新增
以下为原内容
请求接口401 错误


Paste_Image.png Paste_Image.png Paste_Image.png
#import "AFURLResponseSerialization.h"
        NSData * data = error.userInfo[AFNetworkingOperationFailingURLResponseDataErrorKey];
        id body = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
        NSDictionary *bodyDic = (NSDictionary*)body;
        NSMutableDictionary *errDic = [[NSMutableDictionary alloc] init];
        if ([bodyDic stringForKey:@"error"]) {
            errDic[@"error"] = [bodyDic stringForKey:@"error"];
        }
上一篇下一篇

猜你喜欢

热点阅读