mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 12:27:52 +08:00
Add support for the registration of HTTP request operation subclasses on the manager to support easy customization of request operation handling. refs #997
This commit is contained in:
@@ -390,6 +390,18 @@ RKMappingResult, RKRequestDescriptor, RKResponseDescriptor;
|
||||
/// @name Creating Object Request Operations
|
||||
///-----------------------------------------
|
||||
|
||||
/**
|
||||
Sets the `RKHTTPRequestOperation` subclass to be used when constructing HTTP request operations for requests dispatched through the manager.
|
||||
|
||||
When set, an instance of the given class will be initialized via `initWithRequest:` each time that the receiver constructs an HTTP request operation. HTTP request operations are used to initialize instances of `RKObjectRequestOperation` and are responsible for managing the HTTP request/response lifecycle of a request whose response is destined to be object mapped. Providing a subclass implementation of `RKHTTPRequestOperation` allows the behavior of all requests sent through the manager to be changed.
|
||||
|
||||
@param operationClass A class object inheriting from `RKHTTPRequestOperation` to be used for HTTP requests dispatched through the manager.
|
||||
@raises `NSInvalidArgumentException` Raised if the given class does not inherit from `RKHTTPRequestOperation`.
|
||||
@see `RKHTTPRequestOperation`
|
||||
@warning The given class must inherit from `RKHTTPRequestOperation`, else an exception will be raised.
|
||||
*/
|
||||
- (void)setHTTPOperationClass:(Class)operationClass;
|
||||
|
||||
/**
|
||||
Creates an `RKObjectRequestOperation` operation with the given request and sets the completion block with the given success and failure blocks.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user