Protocol

NSURLSessionDataDelegate

The NSURLSessionDataDelegate protocol defines the methods that a delegate of an NSURLSession object can implement to handle task-level events specific to data tasks and upload tasks. Your session delegate should also implement the methods in the NSURLSessionTaskDelegate protocol to handle task-level events that are common to all task types, and methods in the NSURLSessionDelegate protocol to handle session-level events.

Overview

Symbols

Delegate Methods

URLSession:dataTask:didReceiveResponse:completionHandler:

Tells the delegate that the data task received the initial reply (headers) from the server.

URLSession:dataTask:didBecomeDownloadTask:

Tells the delegate that the data task was changed to a download task.

URLSession:dataTask:didBecomeStreamTask:

Tells the delegate that the data task was changed to a streamtask.

URLSession:dataTask:didReceiveData:

Tells the delegate that the data task has received some of the expected data.

URLSession:dataTask:willCacheResponse:completionHandler:

Asks the delegate whether the data (or upload) task should store the response in the cache.

Constants

NSURLSessionResponseDisposition

Constants indicating how a data or upload session should proceed after receiving the initial headers.

Relationships