---
title: URLSession.ResponseDisposition
framework: foundation
role: symbol
role_heading: Enumeration
path: foundation/urlsession/responsedisposition
---

# URLSession.ResponseDisposition

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

## Declaration

```swift
enum ResponseDisposition
```

## Overview

Overview When a data or upload task first receives a response, it calls the  urlSession(_:dataTask:didReceive:completionHandler:) method of URLSessionDataDelegate. Implement this method to inspect the received 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](foundation/urlsession/responsedisposition/cancel.md)
- [URLSession.ResponseDisposition.allow](foundation/urlsession/responsedisposition/allow.md)
- [URLSession.ResponseDisposition.becomeDownload](foundation/urlsession/responsedisposition/becomedownload.md)
- [URLSession.ResponseDisposition.becomeStream](foundation/urlsession/responsedisposition/becomestream.md)

### Initializers

- [init(rawValue:)](foundation/urlsession/responsedisposition/init(rawvalue:).md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Handling task life cycle changes

- [urlSession(_:dataTask:didReceive:completionHandler:)](foundation/urlsessiondatadelegate/urlsession(_:datatask:didreceive:completionhandler:).md)
- [urlSession(_:dataTask:didBecome:)](foundation/urlsessiondatadelegate/urlsession(_:datatask:didbecome:)-60op5.md)
- [urlSession(_:dataTask:didBecome:)](foundation/urlsessiondatadelegate/urlsession(_:datatask:didbecome:)-7nqzu.md)
