<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLSession/ResponseDisposition",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@E@NSURLSessionResponseDisposition"
  },
  "title" : "URLSession.ResponseDisposition"
}
-->

# URLSession.ResponseDisposition

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

```
enum ResponseDisposition
```

## Overview

When a data or upload task first receives a response, it calls the  [`urlSession(_:dataTask:didReceive:completionHandler:)`](/documentation/Foundation/URLSessionDataDelegate/urlSession(_:dataTask:didReceive:completionHandler:)) method of [`URLSessionDataDelegate`](/documentation/Foundation/URLSessionDataDelegate). Implement this method to inspect the received [`URLResponse`](/documentation/Foundation/URLResponse) 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

[`URLSession.ResponseDisposition.cancel`](/documentation/Foundation/URLSession/ResponseDisposition/cancel)

Cancel the load.

[`URLSession.ResponseDisposition.allow`](/documentation/Foundation/URLSession/ResponseDisposition/allow)

Allow the load operation to continue.

[`URLSession.ResponseDisposition.becomeDownload`](/documentation/Foundation/URLSession/ResponseDisposition/becomeDownload)

Convert the response for this request to use a [`URLSessionDownloadTask`](/documentation/Foundation/URLSessionDownloadTask).

[`URLSession.ResponseDisposition.becomeStream`](/documentation/Foundation/URLSession/ResponseDisposition/becomeStream)

Convert the response for this request to use a [`URLSessionStreamTask`](/documentation/Foundation/URLSessionStreamTask).



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)