I am trying with this but every time I will get
{ error = "invalid_request"; "error_description" = "Required parameter is missing: grant_type"; }
Request String:
let headers = [ "Content-Type" : "application/x-www-form-urlencoded"]
let urlString = "https://accounts.google.com/o/oauth2/token?"
Alamofire.request(urlString, method: .post, parameters: ["grant_type":"authorization_code","code":"4/FAOYR1mQo1lN1Gdg9jDnigwZ8RP76NUrqPbYZlMCSP28","client_id":"387376833747-12pbtud9tepr4di0insdhc0d4qpf5e9m.apps.googleusercontent.com","client_secret":"xOacVhLavM9fH8SpOK4I2dRJ","redirect_uri":"https://stackoverflow.com"], encoding: JSONEncoding.default, headers : headers)
.responseJSON { response in
print(response)
print(response.result)
}
也嘗試傳遞這樣的請求參數,但仍然不適合我。{error =「invalid_request」; 「error_description」=「缺少必需的參數:grant_type」; }在迅速
authorization_code呢?我必須通過? –
您需要按照我所述的方式通過。 – KKRocks
我已經完成了與你所描述的相同,但我必須通過authorization_code值其他明智它給我錯誤未解決標識符authorization_code。 –