Inherits from NSObject
Declared in IMFResourceRequest.h

Overview

 Request method is nil.

Class Methods

requestWithPath:

Returns an IMFResourceRequest object initialized with path. The path should not be nil, otherwise other methods will fail.

+ (IMFResourceRequest *)requestWithPath:(NSString *)path

Parameters

path

Path to resource

Return Value

IMFResourceRequest initialized with path to resource

Declared In

IMFResourceRequest.h

requestWithPath:method:

  • Returns an IMFResourceRequest object initialized with path and request method. The path should not be nil, otherwise other methods will fail.
  • @param path Path to resource
  • @param method Request method. It can be any of the permitted HTTP methods, for example “GET”, “POST”, “PUT”, “DELETE”, “HEAD”.
  • @return IMFResourceRequest initialized with path to resource and request method
+ (IMFResourceRequest *)requestWithPath:(NSString *)path method:(NSString *)method

Discussion

  • @exception NSInvalidArgumentException If the URL doesn’t start with a protocol (scheme) an NSInvalidArgumentException is thrown

Declared In

IMFResourceRequest.h

requestWithPath:method:parameters:

Returns an IMFResourceRequest object initialized with path, request method and request parameters. The path should not be nil, otherwise other methods will fail.

+ (IMFResourceRequest *)requestWithPath:(NSString *)path method:(NSString *)method parameters:(NSDictionary *)parameters

Parameters

path

Full path to resource

method

Request method. It can be any of the permitted HTTP methods, for example “GET”, “POST”, “PUT”, “DELETE”, “HEAD”.

parameters

Request parameters

Return Value

IMFResourceRequest initialized with path to resource, request method and request parameters

Exceptions

NSInvalidArgumentException

If the URL doesn’t start with a protocol (scheme) an NSInvalidArgumentException is thrown

Declared In

IMFResourceRequest.h

requestWithPath:method:parameters:timeout:

Returns an IMFResourceRequest object initialized with path, request method and request parameters. The path should not be nil, otherwise other methods will fail.

+ (IMFResourceRequest *)requestWithPath:(NSString *)path method:(NSString *)method parameters:(NSDictionary *)parameters timeout:(NSTimeInterval)timeoutInterval

Parameters

path

Full path to resource

method

Request method. It can be any of the permitted HTTP methods, for example “GET”, “POST”, “PUT”, “DELETE”, “HEAD”.

parameters

Request parameters

timeout

Request timeout

Return Value

IMFResourceRequest initialized with path to resource, request method, request parameters and timeout

Exceptions

NSInvalidArgumentException

If the URL doesn’t start with a protocol (scheme) an NSInvalidArgumentException is thrown

Declared In

IMFResourceRequest.h

Instance Methods

sendWithCompletionHandler:

Sends request to resource. The request must have been initialized with a valid path.

- (void)sendWithCompletionHandler:(void ( ^ ) ( IMFResponse *response , NSError *error ))completionHandler

Parameters

completionHandler

Block to be called when the request is completed

Discussion

If the request is completed successfully, the error parameter of the completion block is nil and the response parameter contains the server response. If the request fails, the error parameter is not nil and contains an error description. The response parameter may contain a response from the server, or may be nil.

Declared In

IMFResourceRequest.h

setHTTPBody:

Sets HTTP body

This method should be used for POST requests.

- (void)setHTTPBody:(NSData *)data

Parameters

data

The data to be set

Declared In

IMFResourceRequest.h

setHTTPMethod:

Sets request method

- (void)setHTTPMethod:(NSString *)method

Parameters

method

Request method. It can be any of the permitted HTTP methods, for example “GET”, “POST”, “PUT”, “DELETE”, “HEAD”.

Declared In

IMFResourceRequest.h

setParameters:

Sets request parameters

- (void)setParameters:(NSDictionary *)parameters

Parameters

parameters

Request parameters

Declared In

IMFResourceRequest.h

setTimeoutInterval:

Sets request timeout

- (void)setTimeoutInterval:(NSTimeInterval)timeoutInterval

Parameters

timeoutInterval

Request timeout interval in seconds

Declared In

IMFResourceRequest.h

setValue:forHTTPHeaderField:

Sets header value

- (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field

Parameters

value

Value to set

forHTTPHeaderField

Header field

Declared In

IMFResourceRequest.h