Inherits from NSObject
Declared in RKRequest.h
RKRequest.m

Overview

Background Request Policy

On iOS 4.x and higher, UIKit provides support for continueing activities for a limited amount of time in the background. RestKit provides simple support for continuing a request when in the background.

Tasks

Properties

HTTPMethod

The HTTP method as a string used for this request

@property (nonatomic, readonly) NSString *HTTPMethod

Declared In

RKRequest.h

URL

The URL this request is loading

@property (nonatomic, readonly) NSURL *URL

Declared In

RKRequest.h

URLRequest

The underlying NSMutableURLRequest sent for this request

@property (nonatomic, readonly) NSMutableURLRequest *URLRequest

Declared In

RKRequest.h

additionalHTTPHeaders

A Dictionary of additional HTTP Headers to send with the request

@property (nonatomic, retain) NSDictionary *additionalHTTPHeaders

Declared In

RKRequest.h

backgroundPolicy

The policy to take on transition to the background (iOS 4.x and higher only)

@property (nonatomic, assign) RKRequestBackgroundPolicy backgroundPolicy

Discussion

Default: RKRequestBackgroundPolicyCancel

Declared In

RKRequest.h

delegate

The delegate to inform when the request is completed

@property (nonatomic, assign) NSObject<RKRequestDelegate> *delegate

Discussion

If the object implements the RKRequestDelegate protocol, it will receive request lifecycle event messages.

Declared In

RKRequest.h

method

The HTTP verb the request is sent via

@property (nonatomic, assign) RKRequestMethod method

Discussion

@default RKRequestMethodGET

Declared In

RKRequest.h

params

A serializable collection of parameters sent as the HTTP Body of the request

@property (nonatomic, retain) NSObject<RKRequestSerializable> *params

Declared In

RKRequest.h

resourcePath

The resourcePath portion of this loader’s URL

@property (nonatomic, readonly) NSString *resourcePath

Declared In

RKRequest.h

userData

An opaque pointer to associate user defined data with the request.

@property (nonatomic, retain) id userData

Declared In

RKRequest.h

username

Credentials for HTTP AUTH Challenge

@property (nonatomic, retain) NSString *username

Declared In

RKRequest.h

Class Methods

requestWithURL:delegate:

Return a REST request that is ready for dispatching

+ (RKRequest *)requestWithURL:(NSURL *)URL delegate:(id)delegate

Declared In

RKRequest.h

Instance Methods

cancel

Cancels the underlying URL connection. This will send the requestDidCancel: delegate method if your delegate responds to it. It then nils out the delegate to ensure no more messages are sent to it.

- (void)cancel

Declared In

RKRequest.h

didFailLoadWithError:

Callback performed to notify the request that the underlying NSURLConnection has failed with an error.

- (void)didFailLoadWithError:(NSError *)error

Declared In

RKRequest.h

didFinishLoad:

Callback performed to notify the request that the underlying NSURLConnection has completed with a response.

- (void)didFinishLoad:(RKResponse *)response

Declared In

RKRequest.h

initWithURL:

Initialize a synchronous request

- (id)initWithURL:(NSURL *)URL

Declared In

RKRequest.h

initWithURL:delegate:

Initialize a REST request and prepare it for dispatching

- (id)initWithURL:(NSURL *)URL delegate:(id)delegate

Declared In

RKRequest.h

isDELETE

Returns YES when this is a DELETE request

- (BOOL)isDELETE

Declared In

RKRequest.h

isGET

Returns YES when this is a GET request

- (BOOL)isGET

Declared In

RKRequest.h

isLoaded

Returns YES when this request has been completed

- (BOOL)isLoaded

Declared In

RKRequest.h

isLoading

Returns YES when this request is in-progress

- (BOOL)isLoading

Declared In

RKRequest.h

isPOST

Returns YES when this is a POST request

- (BOOL)isPOST

Declared In

RKRequest.h

isPUT

Returns YES when this is a PUT request

- (BOOL)isPUT

Declared In

RKRequest.h

prepareURLRequest

Setup the NSURLRequest. The request must be prepared right before dispatching

- (void)prepareURLRequest

Declared In

RKRequest.h

send

Send the request asynchronously. It will be added to the queue and dispatched as soon as possible.

- (void)send

Declared In

RKRequest.h

sendAsynchronously

Immediately dispatch a request asynchronously, skipping the request queue

- (void)sendAsynchronously

Declared In

RKRequest.h

sendSynchronously

Send the request synchronously and return a hydrated response object

- (RKResponse *)sendSynchronously

Declared In

RKRequest.h

wasSentToResourcePath:

Returns YES when the request was sent to the specified resource path

- (BOOL)wasSentToResourcePath:(NSString *)resourcePath

Declared In

RKRequest.h