The CFHTTPMessage opaque type represents an HTTP message.


Creating a Message

func CFHTTPMessageCreateCopy(CFAllocator?, CFHTTPMessage)

Gets a copy of a CFHTTPMessage object.

func CFHTTPMessageCreateEmpty(CFAllocator?, Bool)

Creates and returns a new, empty CFHTTPMessage object.

func CFHTTPMessageCreateRequest(CFAllocator?, CFString, CFURL, CFString)

Creates and returns a CFHTTPMessage object for an HTTP request.

func CFHTTPMessageCreateResponse(CFAllocator?, CFIndex, CFString?, CFString)

Creates and returns a CFHTTPMessage object for an HTTP response.

Modifying a message

func CFHTTPMessageSetBody(CFHTTPMessage, CFData)

Sets the body of a CFHTTPMessage object.

func CFHTTPMessageSetHeaderFieldValue(CFHTTPMessage, CFString, CFString?)

Sets the value of a header field in an HTTP message.

Getting information from a message

func CFHTTPMessageCopyBody(CFHTTPMessage)

Gets the body from a CFHTTPMessage object.

func CFHTTPMessageCopyAllHeaderFields(CFHTTPMessage)

Gets all header fields from a CFHTTPMessage object.

func CFHTTPMessageCopyHeaderFieldValue(CFHTTPMessage, CFString)

Gets the value of a header field from a CFHTTPMessage object.

func CFHTTPMessageCopyRequestMethod(CFHTTPMessage)

Gets the request method from a CFHTTPMessage object.

func CFHTTPMessageCopyRequestURL(CFHTTPMessage)

Gets the URL from a CFHTTPMessage object.

func CFHTTPMessageCopyVersion(CFHTTPMessage)

Gets the HTTP version from a CFHTTPMessage object.

func CFHTTPMessageIsRequest(CFHTTPMessage)

Returns a boolean indicating whether the CFHTTPMessage is a request or a response.

func CFHTTPMessageIsHeaderComplete(CFHTTPMessage)

Determines whether a message header is complete.

func CFHTTPMessageGetResponseStatusCode(CFHTTPMessage)

Gets the status code from a CFHTTPMessage object representing an HTTP response.

func CFHTTPMessageCopyResponseStatusLine(CFHTTPMessage)

Gets the status line from a CFHTTPMessage object.

Message authentication

func CFHTTPMessageApplyCredentialDictionary(CFHTTPMessage, CFHTTPAuthentication, CFDictionary, UnsafeMutablePointer<CFStreamError>?)

Use a dictionary containing authentication credentials to perform the authentication method specified by a CFHTTPAuthentication object.

Getting the CFHTTPMessage type identifier

func CFHTTPMessageGetTypeID()

Returns the Core Foundation type identifier for the CFHTTPMessage opaque type.

Data Types

class CFHTTPMessage

An opaque reference representing an HTTP message.


CFHTTP Version Constants

Sets the HTTP version in a CFHTTPMessage request or response object.

Authentication Schemes

Constants used to specify the desired authentication scheme for a request.

See Also

Opaque Types


This document describes the CFStream functions for working with FTP connections. It is part of the CFFTP API.


The CFHost API allows you to create instances of the CFHost object that you can use to acquire host information, including names, addresses, and reachability information.


The CFHTTPAuthentication opaque type provides an abstraction of HTTP authentication information.


The CFNetDiagnostics opaque type allows you to diagnose network-related problems.


The CFNetServices API is part of Bonjour, Apple’s implementation of zero-configuration networking (ZEROCONF). The CFNetServices API allows you to register a network service, such as a printer or file server, so that it can be found by name or browsed for by service type and domain. Applications can use the CFNetServices API to discover the services that are available on the network and to find all access information — such as name, IP address, and port number — needed to use each service.