通过失败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];