<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NetworkChannel/sendIdempotent(_:metadata:)-37eiq",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network0A7ChannelCA2A9WebSocketVRszrlE14sendIdempotent_8metadataySS_SayAA18NWProtocolMetadataCGyXEtF"
  },
  "title" : "sendIdempotent(_:metadata:)"
}
-->

# sendIdempotent(_:metadata:)

Send an idempotent text frame on a WebSocket connection.

```
func sendIdempotent(_ content: String, @ProtocolMetadataBuilder metadata builder: () -> [NWProtocolMetadata] = {[]})
```

## Parameters

`content`

A string to send.

`builder`

A builder for specifying metadata about the content to send.

## Discussion

Idempotent content is allowed to be sent before the connection is ready,
and may be replayed across parallel connection attempts. This content
can be sent as part of fast-open protocols, which allows the data to be
sent out sooner than if it were required to wait for connection establishment.

> Warning: Idempotent content will be replayed multiple times on the network.
> It may be subject to weaker security protections than non-idempotent content.

Content that needs to be sensitive to sending backpressure should not be
considered idempotent.

This may be called before the connection is ready, in which case
the send will be enqueued until the connection is ready to send.

---

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)