【IOS】AFURLResponseSerialization - API

// 将返回的data转化为用户所需的格式,比如如果你的responseSerializer是AFJSONResponseSerializer对象那么解析出来的data就是JSON格式
// 1. AFJSONResponseSerializer 接受的content-type有:application/json text/json text/javascript
// 2. AFXMLParserResponseSerializer 接收的content-type有:application/xml text/xml
// 3. AFPropertyListResponseSerializer 接收的content-type有:application/x-plist
// 4. AFImageResponseSerializer 接收的content-type有:image/tiff image/jpeg image/gif image/png image/ico image/x-icon image/bmp image/x-bmp image/x-xbitmap image/x-win-bitmap
// 5. AFCompoundResponseSerializer 一组serializer的集合
@protocol AFURLResponseSerialization <NSObject, NSSecureCoding, NSCopying>
// 将返回的data转化为用户所需的格式
- (nullable id)responseObjectForResponse:(nullable NSURLResponse *)response
                           data:(nullable NSData *)data
                          error:(NSError * _Nullable __autoreleasing *)error NS_SWIFT_NOTHROW;
@end

posted @ 2019-06-30 20:52  220和284  阅读(146)  评论(0编辑  收藏  举报