Our internal class to handle a call to the server.
More...
#import <INServerCall.h>
Inherits NSObject, <MPOAuthAPIAuthDelegate>, and <MPOAuthAPILoadDelegate>.
Our internal class to handle a call to the server.
- (void) abortWithError: |
|
(NSError *) |
error |
|
This method can be called to abort a call and have it send the provided error with its callback.
- Parameters
-
error | An NSError object to be delivered through the callback |
- Todo:
- truly abort loading, if in progress
Cancels the call, calling "abortWithError:nil" has the same effect.
- (void) finishWith: |
|
(NSDictionary *) |
returnObject |
|
A method to finish the call early, but successfully.
Use abortWithError: to finish a call early and unsuccessfully. This method provokes the same actions as if it was fired and returned successfully. This method is NOT being called when the URL connection finishes.
Fires the request as currently prepared.
All get, post and fire methods go through this method in their last step.
- (void) fire: |
|
(NSString *) |
inMethod |
withParameters: |
|
(NSArray *) |
inParameters |
httpMethod: |
|
(NSString *) |
httpMethod |
oauth: |
|
(MPOAuthAPI *) |
inOAuth |
callback: |
|
(INSuccessRetvalueBlock) |
inCallback |
|
|
| |
Most versatile fire method, used internally from the get: and post: methods.
- Parameters
-
inMethod | The method to use, i.e. the REST path |
inParameters | An array full of "key=value" NSString objects, can be nil |
httpMethod | The HTTP-method (GET, PUT, POST) to use |
inOAuth | The MPOAuthAPI instance to use for the call |
inCallback | The callback block to call when the method has finished |
- (void) get: |
|
(NSString *) |
inMethod |
withParameters: |
|
(NSArray *) |
inParameters |
oauth: |
|
(MPOAuthAPI *) |
inOAuth |
callback: |
|
(INSuccessRetvalueBlock) |
inCallback |
|
|
| |
Sends off as a GET request.
- Parameters
-
inMethod | The method to use, i.e. the REST path |
inParameters | An array full of "key=value" NSString objects, can be nil |
inOAuth | The MPOAuthAPI instance to use for the call |
inCallback | The callback block to call when the method has finished |
- (BOOL) isAuthenticationCall |
|
|
|
- (void) parseXML: |
|
(NSString *) |
xmlString |
intoResponseDictionary: |
|
(NSMutableDictionary *) |
dict |
|
|
| |
- (void) post: |
|
(NSString *) |
inMethod |
body: |
|
(NSString *) |
bodyString |
oauth: |
|
(MPOAuthAPI *) |
inOAuth |
callback: |
|
(INSuccessRetvalueBlock) |
inCallback |
|
|
| |
Sends off a POST request with the given body.
- Parameters
-
inMethod | The method to use, i.e. the REST path |
bodyString | The body string to POST |
inOAuth | The MPOAuthAPI instance to use for the call |
inCallback | The callback block to call when the method has finished |
- (void) post: |
|
(NSString *) |
inMethod |
withParameters: |
|
(NSArray *) |
inParameters |
oauth: |
|
(MPOAuthAPI *) |
inOAuth |
callback: |
|
(INSuccessRetvalueBlock) |
inCallback |
|
|
| |
Sends off as a POST request.
- Parameters
-
inMethod | The method to use, i.e. the REST path |
inParameters | An array full of "key=value" NSString objects, can be nil |
inOAuth | The MPOAuthAPI instance to use for the call |
inCallback | The callback block to call when the method has finished |
Body data, takes precedence over "parameters" if length is > 0.
- (BOOL) finishIfAuthenticated |
|
readwritenonatomicassign |
If YES the call is merely a proxy to the OAuth authentication call.
As the name suggests, tells us whether it has been sent on the journey.
The method to call on the server URL.
- (INSuccessRetvalueBlock) myCallback |
|
readwritenonatomiccopy |
The callback after finishing our call.
The call will retain a copy of the oauth instance.
An array with "key=value" strings to be passed to the server, overridden by "body".
The server upon which we are called.
The documentation for this class was generated from the following files:
- IndivoFramework/Classes/INServerCall.h
- IndivoFramework/Classes/INServerCall.m