<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSURLRequest/httpBodyStream",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSURLRequest(py)HTTPBodyStream"
  },
  "title" : "httpBodyStream"
}
-->

# httpBodyStream

The request body as an input stream.

```
var httpBodyStream: InputStream? { get }
```

## Discussion

`nil` if the body stream has not been set. The returned stream is for examination only—it is not safe to manipulate the stream in any way.

The receiver will have either an HTTP body or an HTTP body stream, only one may be set for a request. A HTTP body stream is preserved when copying an [`NSURLRequest`](/documentation/Foundation/NSURLRequest) object, but is lost when a request is archived using the [`NSCoding`](/documentation/Foundation/NSCoding) protocol.

## See Also

[`httpBodyStream`](/documentation/Foundation/NSMutableURLRequest/httpBodyStream)

The request body as an input stream.

[`httpBody`](/documentation/Foundation/NSMutableURLRequest/httpBody)

The request body.



---

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)