---
title: httpBody
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nsurlrequest/httpbody
---

# httpBody

The request body.

## Declaration

```swift
var httpBody: Data? { get }
```

## Discussion

Discussion This data is sent as the message body of a request, as in an HTTP POST request.

## 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)
- [httpBodyStream](foundation/nsurlrequest/httpbodystream.md)
- [mainDocumentURL](foundation/nsurlrequest/maindocumenturl.md)
