<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLSessionWebSocketTask/Message",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:So25NSURLSessionWebSocketTaskC10FoundationE7MessageO"
  },
  "title" : "URLSessionWebSocketTask.Message"
}
-->

# URLSessionWebSocketTask.Message

An enumeration of the types of messages sent and received.

```
enum Message
```

## Topics

### Message types

[`URLSessionWebSocketTask.Message.data(_:)`](/documentation/Foundation/URLSessionWebSocketTask/Message/data(_:))

A WebSocket message that contains a block of data.

[`URLSessionWebSocketTask.Message.string(_:)`](/documentation/Foundation/URLSessionWebSocketTask/Message/string(_:))

A WebSocket message that contains a string.



---

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)