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

# httpBody

The request body.

## Declaration

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

## Discussion

Discussion The request body is sent as the message body of the request, as in an HTTP POST request. Setting the HTTP body data clears any input stream in httpBodyStream. These values are mutually exclusive.

## See Also

### Accessing request components

- [httpMethod](foundation/nsmutableurlrequest/httpmethod.md)
- [url](foundation/nsmutableurlrequest/url.md)
- [httpBodyStream](foundation/nsmutableurlrequest/httpbodystream.md)
- [mainDocumentURL](foundation/nsmutableurlrequest/maindocumenturl.md)
