Initializer

init(url:cachePolicy:timeoutInterval:)

Creates and initializes a URL request with the given URL, cache policy, and timeout interval.

Declaration

init(url: URL, cachePolicy: URLRequest.CachePolicy = .useProtocolCachePolicy, timeoutInterval: TimeInterval = 60.0)

Parameters

url

The URL for the request.

cachePolicy

The cache policy for the request. The default is NSURLRequest.CachePolicy.useProtocolCachePolicy.

timeoutInterval

The timeout interval for the request. The default is 60.0. See the commentary for the timeoutInterval for more information on timeout intervals.