代码是:
Alamofire.request(
"https://...",
method: .post,
parameters: nil,
encoding: URLEncoding.default,
headers: [
"Authorization": "Basic <client_id>:<client_secret>",
"Content-Type": "application/x-www-form-urlencoded"
]
).responseString({ (response) in
print(response)
})
打印语句打印:
{
"error":"invalid_request",
"error_description":"invalid authorization header value format"
}
The document声明标头参数应为:
授权:设置为
Basic <base64 encoded "clientId:clientSecret">
内容类型:application / x-www-form-urlencoded
我在这里做错了什么?