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
INURLLoader Class Reference

This class simplifies loading data from a URL. More...

#import <INURLLoader.h>

Inherits NSObject.

Instance Methods

(void) - cancel
 Aborting the loader. More...
 
(void) - getWithCallback:
 Start loading data from an URL. More...
 
(id) - initWithURL:
 
(void) - performRequest:withCallback:
 Perform an NSURLRequest asynchronically. More...
 
(void) - post:withCallback:
 POST body values to our URL. More...
 

Class Methods

(id) + loaderWithURL:
 
(NSDictionary *) + queryFromRequest:
 Parses arguments from a request. More...
 
(NSDictionary *) + queryFromRequestString:
 Parses arguments from a request URL string. More...
 

Properties

BOOL expectBinaryData
 NO by default. Set to YES if you expect binary data; "responseString" will be left nil! More...
 
NSData * responseData
 Will contain the response data as loaded from url. More...
 
NSUInteger responseStatus
 The HTTP response status code. More...
 
NSString * responseString
 Will contain the response as NSString as loaded from url. More...
 
NSURL * url
 The URL we will load from. More...
 

Detailed Description

This class simplifies loading data from a URL.

Method Documentation

- (void) cancel

Aborting the loader.

- (void) getWithCallback: (INCancelErrorBlock)  callback

Start loading data from an URL.

- (id) initWithURL: (NSURL *)  anURL
+ (id) loaderWithURL: (NSURL *)  anURL
- (void) performRequest: (NSURLRequest *)  aRequest
withCallback: (INCancelErrorBlock)  aCallback 

Perform an NSURLRequest asynchronically.

This method is internally used as the endpoint of all convenience methods, all load operations start here.

- (void) post: (NSString *)  postBody
withCallback: (INCancelErrorBlock)  callback 

POST body values to our URL.

+ (NSDictionary *) queryFromRequest: (NSURLRequest *)  aRequest

Parses arguments from a request.

Returns
An NSDictionary containing all arguments found in the request
Todo:
look in header and body for more arguments
+ (NSDictionary *) queryFromRequestString: (NSString *)  aString

Parses arguments from a request URL string.

Returns
An NSDictionary containing all arguments found in the request string

Property Documentation

- (BOOL) expectBinaryData
readwritenonatomicassign

NO by default. Set to YES if you expect binary data; "responseString" will be left nil!

- (NSData*) responseData
readnonatomiccopy

Will contain the response data as loaded from url.

- (NSUInteger) responseStatus
readnonatomicassign

The HTTP response status code.

- (NSString*) responseString
readnonatomiccopy

Will contain the response as NSString as loaded from url.

- (NSURL*) url
readwritenonatomicstrong

The URL we will load from.


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