我试图在swift中使用oAuth撤销Fitbit令牌。我一直收到以下错误,
无法完成操作。 (OAuthSwiftError错误-11。)
以下是我为此所写的内容:
func logout() {
let token = UserDefaults.standard.value(forKey: "Atoken")
let perm = ["token": token]
let head = ["Authorization": "Basic "+(fitbit_consumer_secret)]
oauthswift.client.post("https://api.fitbit.com/oauth2/revoke", parameters: perm, headers: head, success: { (response) in
print("Data: \(response)")
}, failure: { (error) in
print("Error: \(error.localizedDescription)")
})
}