Instance Method

initWithURL:cachePolicy:timeoutInterval:

Creates a URL request with the specified URL, cache policy, and timeout values.

Declaration

- (instancetype)initWithURL:(NSURL *)URL cachePolicy:(NSURLRequestCachePolicy)cachePolicy timeoutInterval:(NSTimeInterval)timeoutInterval;

Parameters

theURL

The URL for the request.

cachePolicy

The cache policy for the request.

timeoutInterval

The timeout interval for the request, in seconds.

Return Value

The initialized URL request.

Discussion

This is the designated initializer for NSURLRequest.

See Also

Creating Requests

+ requestWithURL:

Creates and returns a URL request for a specified URL.

- initWithURL:

Creates a URL request for a specified URL.

+ requestWithURL:cachePolicy:timeoutInterval:

Creates and returns an initialized URL request with specified URL, cache policy, and timeout values.