Instantly share code, notes, and snippets.

Embed
What would you like to do?
var request: URLRequest = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData)
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.addValue("2", forHTTPHeaderField: "trakt-api-version")
request.addValue(self.clientID, forHTTPHeaderField: "trakt-api-key")
if let accessToken = self.accessToken, authenticationRequired
{
request.addValue("Bearer \(accessToken)", forHTTPHeaderField: "Authorization")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment