概览
- 版本:
3.0.4
- 结构图 >
AFNetworking - Serializer
关于 Serializer
看一下它的继承结构
1 |
|
了解一下
发送数据和接收数据的序列化编码封装
AFHTTP*
AFHTTPRequestSerializer
AFHTTPRequestSerializer
conforms to theAFURLRequestSerialization
&AFURLResponseSerialization
protocols, 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
AFHTTPRequestSerializer
in order to ensure consistent default behavior.AFHTTPResponseSerializer
AFHTTPResponseSerializer
conforms to theAFURLRequestSerialization
&AFURLResponseSerialization
protocols, 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
AFHTTPResponseSerializer
in order to ensure consistent default behavior.
AF*RequestSerializer
AFJSONRequestSerializer
AFJSONRequestSerializer
is a subclass ofAFHTTPRequestSerializer
that encodes parameters asJSON
usingNSJSONSerialization
, setting the Content-Type of the encoded request toapplication/json
.AFPropertyListRequestSerializer
AFPropertyListRequestSerializer
is a subclass ofAFHTTPRequestSerializer
that encodes parameters asJSON
usingNSPropertyListSerializer
, setting the Content-Type of the encoded request toapplication/x-plist
.
AF*ResponseSerializer
AFPropertyListResponseSerializer
AFPropertyListResponseSerializer
is a subclass ofAFHTTPResponseSerializer
that validates and decodesXML
responses as anNSXMLDocument
objects.By default,
AFPropertyListResponseSerializer
accepts the followingMIME
types:- application/x-plist
AFXMLParserResponseSerializer
AFXMLParserResponseSerializer
is a subclass ofAFHTTPResponseSerializer
that validates and decodesXML
responses as anNSXMLParser
objects.By default,
AFXMLParserResponseSerializer
accepts the followingMIME
types, which includes the official standard, application/xml, as well as other commonly-used types:- application/xml - text/xml
AFXMLDocumentResponseSerializer
AFXMLDocumentResponseSerializer
is a subclass ofAFHTTPResponseSerializer
that validates and decodesXML
responses as anNSXMLDocument
objects.By default,
AFXMLDocumentResponseSerializer
accepts the followingMIME
types, which includes the official standard, application/xml, as well as other commonly-used types:- application/xml - text/xml
AFJSONResponseSerializer
AFJSONResponseSerializer
is a subclass ofAFHTTPResponseSerializer
that validates and decodesJSON
responses.By default,
AFJSONResponseSerializer
accepts the followingMIME
types, which includes the official standard, application/json, as well as other commonly-used types:- application/json - text/json - text/javascript
AFImageResponseSerializer
AFImageResponseSerializer
is a subclass ofAFHTTPResponseSerializer
that validates and decodesimage
responses.By default,
AFImageResponseSerializer
accepts the followingMIME
types, 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