概览
- 版本:
3.0.4 - 结构图 >

AFNetworking - Serializer
关于 Serializer
看一下它的继承结构
1 |
|
了解一下
发送数据和接收数据的序列化编码封装
AFHTTP*
AFHTTPRequestSerializer
AFHTTPRequestSerializerconforms to theAFURLRequestSerialization&AFURLResponseSerializationprotocols, offering a concrete base implementation of query string / URL form-encoded parameter serialization and default request headers, as well as response status code and content type validation.Any request or response serializer dealing with HTTP is encouraged to subclass
AFHTTPRequestSerializerin order to ensure consistent default behavior.AFHTTPResponseSerializer
AFHTTPResponseSerializerconforms to theAFURLRequestSerialization&AFURLResponseSerializationprotocols, offering a concrete base implementation of query string / URL form-encoded parameter serialization and default request headers, as well as response status code and content type validation.Any request or response serializer dealing with HTTP is encouraged to subclass
AFHTTPResponseSerializerin order to ensure consistent default behavior.
AF*RequestSerializer
AFJSONRequestSerializer
AFJSONRequestSerializeris a subclass ofAFHTTPRequestSerializerthat encodes parameters asJSONusingNSJSONSerialization, setting the Content-Type of the encoded request toapplication/json.AFPropertyListRequestSerializer
AFPropertyListRequestSerializeris a subclass ofAFHTTPRequestSerializerthat encodes parameters asJSONusingNSPropertyListSerializer, setting the Content-Type of the encoded request toapplication/x-plist.
AF*ResponseSerializer
AFPropertyListResponseSerializer
AFPropertyListResponseSerializeris a subclass ofAFHTTPResponseSerializerthat validates and decodesXMLresponses as anNSXMLDocumentobjects.By default,
AFPropertyListResponseSerializeraccepts the followingMIMEtypes:- application/x-plistAFXMLParserResponseSerializer
AFXMLParserResponseSerializeris a subclass ofAFHTTPResponseSerializerthat validates and decodesXMLresponses as anNSXMLParserobjects.By default,
AFXMLParserResponseSerializeraccepts the followingMIMEtypes, which includes the official standard, application/xml, as well as other commonly-used types:- application/xml - text/xmlAFXMLDocumentResponseSerializer
AFXMLDocumentResponseSerializeris a subclass ofAFHTTPResponseSerializerthat validates and decodesXMLresponses as anNSXMLDocumentobjects.By default,
AFXMLDocumentResponseSerializeraccepts the followingMIMEtypes, which includes the official standard, application/xml, as well as other commonly-used types:- application/xml - text/xmlAFJSONResponseSerializer
AFJSONResponseSerializeris a subclass ofAFHTTPResponseSerializerthat validates and decodesJSONresponses.By default,
AFJSONResponseSerializeraccepts the followingMIMEtypes, which includes the official standard, application/json, as well as other commonly-used types:- application/json - text/json - text/javascriptAFImageResponseSerializer
AFImageResponseSerializeris a subclass ofAFHTTPResponseSerializerthat validates and decodesimageresponses.By default,
AFImageResponseSerializeraccepts the followingMIMEtypes, which correspond to the image formats supported by UIImage or NSImage:- 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