requestHeaderFields(with:)
Converts an array of cookies to a dictionary of header fields.
Declaration
class func requestHeaderFields(with cookies: [HTTPCookie]) -> [String : String]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 URLSessionTask instance based on that request object.