Type Method

requestHeaderFieldsWithCookies:

Converts an array of cookies to a dictionary of header fields.

Declaration

+ (NSDictionary<NSString *,NSString *> *)requestHeaderFieldsWithCookies:(NSArray<NSHTTPCookie *> *)cookies;

Parameters

cookies

The cookies from which the header fields are created.

Return Value

The dictionary of header fields created from the provided cookies.

Discussion

To send these headers as part of a URL request to a remote server, create an NSMutableURLRequest object, then call the allHTTPHeaderFields or setValue:forHTTPHeaderField: method to set the provided headers for the request. Finally, initialize and start an NSURLSessionTask instance based on that request object.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software