Я пытаюсь использовать функцию http.post () в системе API oauth2.Я не могу понять, как отправить параметры.
String grant_type = "authorization_code";
var body = jsonEncode({
'x-www-form-urlencoded': {
'grant_type': grant_type,
'code': code,
'redirect_uri': redirect_uri,
'client_id': client_id,
'client_secret': client_secret
}
});
var a = await http.post(url,
headers: {
"Authorization":
"Basic <base64 Client Id>",
"Content-Type": "application/x-www-form-urlencoded"
},
body: body
);
}
Это сообщение возвращает запрос отклонен ошибка.