<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 8.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLError/requestBodyStreamExhausted",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation8URLErrorV26requestBodyStreamExhaustedAC4CodeVvpZ"
  },
  "title" : "requestBodyStreamExhausted"
}
-->

# requestBodyStreamExhausted

A body stream is needed but the client didn’t provide one.

```
static var requestBodyStreamExhausted: URLError.Code { get }
```

## Discussion

This error applies to clients on iOS that send a `POST` request using a body stream but don’t implement the [`URLSessionTaskDelegate`](/documentation/Foundation/URLSessionTaskDelegate) method [`urlSession(_:task:needNewBodyStream:)`](/documentation/Foundation/URLSessionTaskDelegate/urlSession(_:task:needNewBodyStream:)).

---

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)