---
title: URLSessionWebSocketTask.CloseCode.unsupportedData
framework: foundation
role: symbol
role_heading: Case
path: foundation/urlsessionwebsockettask/closecode-swift.enum/unsupporteddata
---

# URLSessionWebSocketTask.CloseCode.unsupportedData

A code that indicates an endpoint terminated the connection after receiving a type of data it can’t accept.

## Declaration

```swift
case unsupportedData
```

## Discussion

Discussion An endpoint that only accepts text may send this close code if it receives a binary message.

## See Also

### Close codes

- [URLSessionWebSocketTask.CloseCode.abnormalClosure](foundation/urlsessionwebsockettask/closecode-swift.enum/abnormalclosure.md)
- [URLSessionWebSocketTask.CloseCode.goingAway](foundation/urlsessionwebsockettask/closecode-swift.enum/goingaway.md)
- [URLSessionWebSocketTask.CloseCode.internalServerError](foundation/urlsessionwebsockettask/closecode-swift.enum/internalservererror.md)
- [URLSessionWebSocketTask.CloseCode.invalid](foundation/urlsessionwebsockettask/closecode-swift.enum/invalid.md)
- [URLSessionWebSocketTask.CloseCode.invalidFramePayloadData](foundation/urlsessionwebsockettask/closecode-swift.enum/invalidframepayloaddata.md)
- [URLSessionWebSocketTask.CloseCode.mandatoryExtensionMissing](foundation/urlsessionwebsockettask/closecode-swift.enum/mandatoryextensionmissing.md)
- [URLSessionWebSocketTask.CloseCode.messageTooBig](foundation/urlsessionwebsockettask/closecode-swift.enum/messagetoobig.md)
- [URLSessionWebSocketTask.CloseCode.noStatusReceived](foundation/urlsessionwebsockettask/closecode-swift.enum/nostatusreceived.md)
- [URLSessionWebSocketTask.CloseCode.normalClosure](foundation/urlsessionwebsockettask/closecode-swift.enum/normalclosure.md)
- [URLSessionWebSocketTask.CloseCode.policyViolation](foundation/urlsessionwebsockettask/closecode-swift.enum/policyviolation.md)
- [URLSessionWebSocketTask.CloseCode.protocolError](foundation/urlsessionwebsockettask/closecode-swift.enum/protocolerror.md)
- [URLSessionWebSocketTask.CloseCode.tlsHandshakeFailure](foundation/urlsessionwebsockettask/closecode-swift.enum/tlshandshakefailure.md)
