---
title: "CFHTTPMessageCreateEmpty(_:_:)"
framework: cfnetwork
role: symbol
role_heading: Function
path: "cfnetwork/cfhttpmessagecreateempty(_:_:)"
---

# CFHTTPMessageCreateEmpty(_:_:)

Creates and returns a new, empty CFHTTPMessage object.

## Declaration

```swift
func CFHTTPMessageCreateEmpty(_ alloc: CFAllocator?, _ isRequest: Bool) -> Unmanaged<CFHTTPMessage>
```

## Parameters

- `isRequest`: A flag that determines whether to create an empty message request or an empty message response. Pass TRUE to create an empty request message; pass FALSE to create an empty response message.

## Return Value

Return Value A new CFHTTPMessage object or NULL if there was a problem creating the object. Ownership follows the The Create Rule.

## Discussion

Discussion Call CFHTTPMessageAppendBytes(_:_:_:) to store an incoming, serialized HTTP request or response message in the empty message object.

## See Also

### HTTP Messages

- [CFHTTPMessage](cfnetwork/cfhttpmessage.md)
- [CFHTTPMessageAddAuthentication(_:_:_:_:_:_:)](cfnetwork/cfhttpmessageaddauthentication(_:_:_:_:_:_:).md)
- [CFHTTPMessageAppendBytes(_:_:_:)](cfnetwork/cfhttpmessageappendbytes(_:_:_:).md)
- [CFHTTPMessageApplyCredentialDictionary(_:_:_:_:)](cfnetwork/cfhttpmessageapplycredentialdictionary(_:_:_:_:).md)
- [CFHTTPMessageApplyCredentials(_:_:_:_:_:)](cfnetwork/cfhttpmessageapplycredentials(_:_:_:_:_:).md)
- [CFHTTPMessageCopyAllHeaderFields(_:)](cfnetwork/cfhttpmessagecopyallheaderfields(_:).md)
- [CFHTTPMessageCopyBody(_:)](cfnetwork/cfhttpmessagecopybody(_:).md)
- [CFHTTPMessageCopyHeaderFieldValue(_:_:)](cfnetwork/cfhttpmessagecopyheaderfieldvalue(_:_:).md)
- [CFHTTPMessageCopyRequestMethod(_:)](cfnetwork/cfhttpmessagecopyrequestmethod(_:).md)
- [CFHTTPMessageCopyRequestURL(_:)](cfnetwork/cfhttpmessagecopyrequesturl(_:).md)
- [CFHTTPMessageCopyResponseStatusLine(_:)](cfnetwork/cfhttpmessagecopyresponsestatusline(_:).md)
- [CFHTTPMessageCopySerializedMessage(_:)](cfnetwork/cfhttpmessagecopyserializedmessage(_:).md)
- [CFHTTPMessageCopyVersion(_:)](cfnetwork/cfhttpmessagecopyversion(_:).md)
- [CFHTTPMessageCreateCopy(_:_:)](cfnetwork/cfhttpmessagecreatecopy(_:_:).md)
- [CFHTTPMessageCreateRequest(_:_:_:_:)](cfnetwork/cfhttpmessagecreaterequest(_:_:_:_:).md)
