---
title: httpBodyStream
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nsurlrequest/httpbodystream
---

# httpBodyStream

The request body as an input stream.

## Declaration

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

## Discussion

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 object, but is lost when a request is archived using the NSCoding protocol.

## See Also

### Related Documentation

- [httpBodyStream](foundation/nsmutableurlrequest/httpbodystream.md)
- [httpBody](foundation/nsmutableurlrequest/httpbody.md)

### Accessing request components

- [httpMethod](foundation/nsurlrequest/httpmethod.md)
- [url](foundation/nsurlrequest/url.md)
- [httpBody](foundation/nsurlrequest/httpbody.md)
- [mainDocumentURL](foundation/nsurlrequest/maindocumenturl.md)
