Function

CFHTTPMessageCopyHeaderFieldValue(_:_:)

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

Declaration

func CFHTTPMessageCopyHeaderFieldValue(_ message: CFHTTPMessage, _ headerField: CFString) -> Unmanaged<CFString>?

Parameters

message

The message to examine.

headerField

The header field to copy.

Return Value

A CFString object containing a copy of the field specified by headerField, or NULL if there was a problem creating the object of if the specified header does not exist. Ownership follows the The Create Rule.

See Also

HTTP Messages

class CFHTTPMessage

An opaque reference representing an HTTP message.

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

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

func CFHTTPMessageCopyBody(CFHTTPMessage) -> Unmanaged<CFData>?

Gets the body from a CFHTTPMessage object.

func CFHTTPMessageCopyRequestMethod(CFHTTPMessage) -> Unmanaged<CFString>?

Gets the request method from a CFHTTPMessage object.

func CFHTTPMessageCopyVersion(CFHTTPMessage) -> Unmanaged<CFString>

Gets the HTTP version from a CFHTTPMessage object.

func CFHTTPMessageCreateEmpty(CFAllocator?, Bool) -> Unmanaged<CFHTTPMessage>

Creates and returns a new, empty CFHTTPMessage object.

func CFHTTPMessageGetResponseStatusCode(CFHTTPMessage) -> CFIndex

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

func CFHTTPMessageGetTypeID() -> CFTypeID

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

func CFHTTPMessageIsHeaderComplete(CFHTTPMessage) -> Bool

Determines whether a message header is complete.

func CFHTTPMessageIsRequest(CFHTTPMessage) -> Bool

Returns a Boolean indicating whether the HTTP message is a request or a response.

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.

let kCFHTTPVersion1_0: CFString

Specifies HTTP version 1.0.

let kCFHTTPVersion1_1: CFString

Specifies HTTP version 1.1.