Enumeration

NSURLSessionResponseDisposition

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

Declaration

typedef enum NSURLSessionResponseDisposition : NSInteger {
    ...
} NSURLSessionResponseDisposition;

Overview

When a data or upload task first receives a response, it calls the URLSession:dataTask:didReceiveResponse:completionHandler: method of NSURLSessionDataDelegate. Implement this method to inspect the received NSURLResponse and then call the provided completion handler. The first parameter to the completion handler is of this type, a disposition that tells the task how to proceed.

Topics

Task Dispositions

NSURLSessionResponseAllow

Allow the load operation to continue.

NSURLSessionResponseBecomeDownload

Convert the response for this request to use a NSURLSessionDownloadTask.

NSURLSessionResponseBecomeStream

Convert the response for this request to use a NSURLSessionStreamTask.

See Also

Handling Task Life Cycle Changes

- 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 stream task.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software