Indivo Framework (iOS)
An iOS framework for Apps connecting to Indivo server
 All Classes Functions Variables Properties Pages
Instance Methods | Class Methods | Properties | List of all members
INServerCall Class Reference

Our internal class to handle a call to the server. More...

#import <INServerCall.h>

Inherits NSObject, <MPOAuthAPIAuthDelegate>, and <MPOAuthAPILoadDelegate>.

Instance Methods

(void) - abortWithError:
 This method can be called to abort a call and have it send the provided error with its callback. More...
 
(void) - cancel
 Cancels the call, calling "abortWithError:nil" has the same effect. More...
 
(void) - finishWith:
 A method to finish the call early, but successfully. More...
 
(void) - fire
 Fires the request as currently prepared. More...
 
(void) - fire:withParameters:httpMethod:oauth:callback:
 Most versatile fire method, used internally from the get: and post: methods. More...
 
(void) - get:withParameters:oauth:callback:
 Sends off as a GET request. More...
 
(id) - initWithServer:
 
(BOOL) - isAuthenticationCall
 
(void) - parseXML:intoResponseDictionary:
 
(void) - post:body:oauth:callback:
 Sends off a POST request with the given body. More...
 
(void) - post:withParameters:oauth:callback:
 Sends off as a POST request. More...
 

Class Methods

(INServerCall *) + newForServer:
 

Properties

NSString * body
 Body data, takes precedence over "parameters" if length is > 0. More...
 
BOOL finishIfAuthenticated
 If YES the call is merely a proxy to the OAuth authentication call. More...
 
BOOL hasBeenFired
 As the name suggests, tells us whether it has been sent on the journey. More...
 
NSString * HTTPMethod
 Will be GET by default. More...
 
NSString * method
 The method to call on the server URL. More...
 
INSuccessRetvalueBlock myCallback
 The callback after finishing our call. More...
 
MPOAuthAPI * oauth
 The call will retain a copy of the oauth instance. More...
 
NSArray * parameters
 An array with "key=value" strings to be passed to the server, overridden by "body". More...
 
IndivoServerserver
 The server upon which we are called. More...
 

Detailed Description

Our internal class to handle a call to the server.

Method Documentation

- (void) abortWithError: (NSError *)  error

This method can be called to abort a call and have it send the provided error with its callback.

Parameters
errorAn NSError object to be delivered through the callback
Todo:
truly abort loading, if in progress
- (void) cancel

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.

- (void) fire

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
inMethodThe method to use, i.e. the REST path
inParametersAn array full of "key=value" NSString objects, can be nil
httpMethodThe HTTP-method (GET, PUT, POST) to use
inOAuthThe MPOAuthAPI instance to use for the call
inCallbackThe 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
inMethodThe method to use, i.e. the REST path
inParametersAn array full of "key=value" NSString objects, can be nil
inOAuthThe MPOAuthAPI instance to use for the call
inCallbackThe callback block to call when the method has finished
- (id) initWithServer: (IndivoServer *)  aServer
- (BOOL) isAuthenticationCall
+ (INServerCall *) newForServer: (IndivoServer *)  aServer
- (void) parseXML: (NSString *)  xmlString
intoResponseDictionary: (NSMutableDictionary *)  dict 

Provided by category INServerCall(XMLParsing).

- (void) post: (NSString *)  inMethod
body: (NSString *)  bodyString
oauth: (MPOAuthAPI *)  inOAuth
callback: (INSuccessRetvalueBlock)  inCallback 

Sends off a POST request with the given body.

Parameters
inMethodThe method to use, i.e. the REST path
bodyStringThe body string to POST
inOAuthThe MPOAuthAPI instance to use for the call
inCallbackThe 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
inMethodThe method to use, i.e. the REST path
inParametersAn array full of "key=value" NSString objects, can be nil
inOAuthThe MPOAuthAPI instance to use for the call
inCallbackThe callback block to call when the method has finished

Property Documentation

- (NSString*) body
readwritenonatomiccopy

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.

- (BOOL) hasBeenFired
readnonatomicassign

As the name suggests, tells us whether it has been sent on the journey.

- (NSString*) HTTPMethod
readwritenonatomiccopy

Will be GET by default.

- (NSString*) method
readwritenonatomiccopy

The method to call on the server URL.

- (INSuccessRetvalueBlock) myCallback
readwritenonatomiccopy

The callback after finishing our call.

- (MPOAuthAPI*) oauth
readwritenonatomicstrong

The call will retain a copy of the oauth instance.

- (NSArray*) parameters
readwritenonatomicstrong

An array with "key=value" strings to be passed to the server, overridden by "body".

- (IndivoServer*) server
readwritenonatomicassign

The server upon which we are called.


The documentation for this class was generated from the following files: