通过失败block内的参数error取得,代码如下:
NSData *data = (NSData *)error.userInfo[AFNetworkingOperationFailingURLResponseDataErrorKey] ;
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
通过失败block内的参数error取得,代码如下:
NSData *data = (NSData *)error.userInfo[AFNetworkingOperationFailingURLResponseDataErrorKey] ;
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:nil];
本文标题:AFNetworking3.x获得failure时候的respo
本文链接:https://www.haomeiwen.com/subject/cjivbxtx.html
网友评论