Inherits from NSObject
Declared in SRHttpHelper.h

Overview

SRHttpHelper is an object used to create HttpRequest objects that are configured for the various http request methods (GET, PUT etc)

Tasks

Initialization

GET Requests

POST Requests

Class Methods

getAsync:continueWith:

Creates a GET request with the specified url returns on the given block

+ (void)getAsync:(NSString *)url continueWith:(void ( ^ ) ( id response ))block

Parameters

url

The url relative to the server endpoint

block

A function to be called when the post finishes. The block should handle both SUCCESS and FAILURE

Declared In

SRHttpHelper.h

getAsync:parameters:continueWith:

Creates a GET request with the specified url returns on the given block

+ (void)getAsync:(NSString *)url parameters:(id)parameters continueWith:(void ( ^ ) ( id response ))block

Parameters

url

The url relative to the server endpoint

parameters

An Object that conforms to proxyForJSON to pass as parameters to the endpoint This can be used to modify properties of the POST, for example timeout or cache protocol

block

A function to be called when the post finishes. The block should handle both SUCCESS and FAILURE

Declared In

SRHttpHelper.h

getAsync:requestPreparer:continueWith:

Creates a GET request with the specified url returns on the given block

+ (void)getAsync:(NSString *)url requestPreparer:(void ( ^ ) ( id ))requestPreparer continueWith:(void ( ^ ) ( id response ))block

Parameters

url

The url relative to the server endpoint

requestPreparer

A function to be called on the NSMutableURLRequest created for the request This can be used to modify properties of the POST, for example timeout or cache protocol

block

A function to be called when the post finishes. The block should handle both SUCCESS and FAILURE

Declared In

SRHttpHelper.h

getAsync:requestPreparer:parameters:continueWith:

Creates a GET request with the specified url returns on the given block

+ (void)getAsync:(NSString *)url requestPreparer:(void ( ^ ) ( id ))requestPreparer parameters:(id)parameters continueWith:(void ( ^ ) ( id response ))block

Parameters

url

The url relative to the server endpoint

requestPreparer

A function to be called on the NSMutableURLRequest created for the request This can be used to modify properties of the POST, for example timeout or cache protocol

parameters

An Object that conforms to proxyForJSON to pass as parameters to the endpoint

block

A function to be called when the post finishes. The block should handle both SUCCESS and FAILURE

Declared In

SRHttpHelper.h

postAsync:continueWith:

Creates a POST request with the specified url returns on the given block This POST will contain no payload

+ (void)postAsync:(NSString *)url continueWith:(void ( ^ ) ( id response ))block

Parameters

url

The url relative to the server endpoint

block

A function to be called when the post finishes. The block should handle both SUCCESS and FAILURE

Declared In

SRHttpHelper.h

postAsync:postData:continueWith:

Creates a POST request with the specified url and payload returns on the given block This POST will have a payload that is generated from @postData

+ (void)postAsync:(NSString *)url postData:(id)postData continueWith:(void ( ^ ) ( id response ))block

Parameters

url

The url relative to the server endpoint

postData

An Object that conforms to proxyForJSON to post at the url

block

A function to be called when the post finishes. The block should handle both SUCCESS and FAILURE

Declared In

SRHttpHelper.h

postAsync:requestPreparer:continueWith:

Creates a POST request with the specified url returns on the given block This POST will contain no payload

+ (void)postAsync:(NSString *)url requestPreparer:(void ( ^ ) ( id ))requestPreparer continueWith:(void ( ^ ) ( id response ))block

Parameters

url

The url relative to the server endpoint

requestPreparer

A function to be called on the NSMutableURLRequest created for the request This can be used to modify properties of the POST, for example timeout or cache protocol

block

A function to be called when the post finishes. The block should handle both SUCCESS and FAILURE

Declared In

SRHttpHelper.h

postAsync:requestPreparer:postData:continueWith:

Creates a POST request with the specified url and payload returns on the given block This POST will have a payload that is generated from @postData

+ (void)postAsync:(NSString *)url requestPreparer:(void ( ^ ) ( id ))requestPreparer postData:(id)postData continueWith:(void ( ^ ) ( id response ))block

Parameters

url

The url relative to the server endpoint

requestPreparer

A function to be called on the NSMutableURLRequest created for the request This can be used to modify properties of the POST, for example timeout or cache protocol

postData

An Object that conforms to proxyForJSON to post at the url

block

A function to be called when the post finishes. The block should handle both SUCCESS and FAILURE

Declared In

SRHttpHelper.h

sharedHttpRequestManager

Initializes a Singleton for SRHttpHelper

+ (id)sharedHttpRequestManager

Declared In

SRHttpHelper.h