---
title: "CFHTTPMessageCreateCopy(_:_:)"
framework: cfnetwork
role: symbol
role_heading: Function
path: "cfnetwork/cfhttpmessagecreatecopy(_:_:)"
---

# CFHTTPMessageCreateCopy(_:_:)

Gets a copy of a CFHTTPMessage object.

## Declaration

```swift
func CFHTTPMessageCreateCopy(_ alloc: CFAllocator?, _ message: CFHTTPMessage) -> Unmanaged<CFHTTPMessage>
```

## Parameters

- `message`: The message to copy.

## Return Value

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

## Discussion

Discussion This function returns a copy of a CFHTTPMessage object that you can modify, for example, by calling CFHTTPMessageCopyHeaderFieldValue(_:_:) or by calling CFHTTPMessageSetBody(_:_:). Then you can serialize the message by calling CFHTTPMessageCopySerializedMessage(_:) and send the serialized message to a client or a server.

## 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)
- [CFHTTPMessageCreateEmpty(_:_:)](cfnetwork/cfhttpmessagecreateempty(_:_:).md)
- [CFHTTPMessageCreateRequest(_:_:_:_:)](cfnetwork/cfhttpmessagecreaterequest(_:_:_:_:).md)
