RKRequestSerializable Protocol Reference
Conforms to | NSObject |
Declared in | RKRequestSerializable.h |
Overview
This protocol is implemented by objects that can be serialized into a representation suitable for transmission over a REST request. Suitable serializations are x-www-form-urlencoded and multipart/form-data.
Warning: One of the following methods MUST be implemented for your serializable implementation to be complete:
- (NSData *)HTTPBody – If you are allowing serialization of a small in-memory data structure, implement HTTPBody as it is much simpler.
- (NSInputStream *)HTTPBodyStream – This provides support for streaming a large payload from disk instead of memory.
Tasks
HTTP Headers
-
– HTTPHeaderValueForContentType
The value of the Content-Type header for the HTTP Body representation of the serialization.
required method
Body Implementation
-
– HTTPBody
An NSData representing the HTTP Body serialization of the object implementing the protocol.
-
– HTTPBodyStream
Returns an input stream for reading the serialization as a stream used to provide support for handling large HTTP payloads.
Optional HTTP Headers
-
– HTTPHeaderValueForContentLength
Returns the length of the HTTP Content-Length header.
-
– ContentTypeHTTPHeader
The value of the Content-Type header for the HTTP Body representation of the serialization.
Instance Methods
ContentTypeHTTPHeader
The value of the Content-Type header for the HTTP Body representation of the serialization.
- (NSString *)ContentTypeHTTPHeader
Return Value
A string value of the Content-Type header for the HTTP body.
Discussion
Bug: DEPRECATED in v0.10.0: Implement [RKRequestSerializable HTTPHeaderValueForContentType] instead.
Declared In
RKRequestSerializable.h
HTTPBody
An NSData representing the HTTP Body serialization of the object implementing the protocol.
- (NSData *)HTTPBody
Return Value
An NSData object respresenting the HTTP body serialization.
Declared In
RKRequestSerializable.h
HTTPBodyStream
Returns an input stream for reading the serialization as a stream used to provide support for handling large HTTP payloads.
- (NSInputStream *)HTTPBodyStream
Return Value
An input stream for reading the serialization as a stream.
Declared In
RKRequestSerializable.h