Creates a read stream for a CFHTTP request message.
- iOS 2.0–9.0Deprecated
- macOS 10.2–10.11Deprecated
- Mac Catalyst 13.0–13.0Deprecated
- tvOS 9.0–9.0Deprecated
The allocator to use to allocate memory for the new object. Pass
NULL or kCFAllocatorDefault to use the current default allocator.
A CFHTTP request message whose body and headers have been set.
A new read stream, or
NULL if there was a problem creating the object. Ownership follows the The Create Rule.
This function creates a read stream and associates it with the specified request. Automatic redirection is disabled by default. After creating the read stream, you can call
CFReadStreamGetError(_:) at any time to check the status of the stream. You may want to call CFHTTPReadStreamSetRedirectsAutomatically to enable automatic redirection, or CFHTTPReadStreamSetProxy to set the name and port number for a proxy. To serialize the request and send it, call
If the body of the request is too long to keep in memory, call
CFReadStreamCreateForStreamedHTTPRequest(_:_:_:) instead of this function.
let kCFStreamPropertyHTTPFinalRequest: CFString
HTTP Final Request property. A value of type CFHTTPMessage containing the final message transmitted by the stream after all modifications (including authentication, connection policy, redirects, and so on) have been made. This property cannot be set.
let kCFStreamPropertyHTTPFinalURL: CFString
HTTP Final URL property. A value of type CFURL containing the final HTTP URL. This value differs from the URL in the original HTTP request if an autoredirection occurred. This property cannot be set.
let kCFStreamPropertyFTPFileTransferOffset: CFString
FTP File Transfer Offset stream property key for set and copy operations. The value of this property is a CFNumber of type
kCFNumberLongLongType representing the file offset at which to start the transfer.
let kCFStreamPropertyFTPPassword: CFString
FTP Password stream property key for set and copy operations. A value of type CFString for storing the login password. Don’t set this property when anonymous FTP is desired.
let kCFStreamPropertyFTPProxy: CFString
FTP Proxy stream property key for set and copy operations. The property is a value of type CFDictionary that holds proxy dictionary key-value pairs. The dictionary returned by SystemConfiguration can also be set as the value of this property.
let kCFStreamPropertyFTPUsePassiveMode: CFString
FTP Passive Mode stream property key for set and copy operations. Set this property to
kCFBooleanTrue to enable passive mode; set this property to
kCFBooleanFalse to disable passive mode.
let kCFStreamPropertyFTPUserName: CFString
FTP User Name stream property key for set and copy operations. A value of type CFString for storing the login user name. Don’t set this property when anonymous FTP is desired.
let kCFStreamNetworkServiceType: CFString
The type of service for the stream. Providing the service type allows the system to properly handle certain attributes of the stream, including routing and suspension behavior. Most streams do not need to set this property. See Stream Service Types for a list of possible values.
let kCFStreamErrorDomainWinSock: CFIndex
When running CFNetwork code on Windows, this domain returns error codes associated with the underlying TCP/IP stack. You should also note that non-networking errors such as
ENOMEM are delivered through the POSIX domain. See the header
winsock2.h for relevant error codes.