【发布时间】:2020-03-04 21:57:21
【问题描述】:
由于 Google Sheets Api 不支持 Xamarin,我正在尝试使用 Xamarin.Auth.OAuth2Request 构建请求。
以下代码表示请求的样子:
Dictionary<string, string> value = new Dictionary<string, string> { { "range", "Arkusz1!A1:B1" },{ "values", "[Test,123]" }};
var request = new OAuth2Request("POST", new Uri("https://sheets.googleapis.com/v4/spreadsheets/13FC0GZPbFbbOk8MW3N4fRvYq3lNKNZqsQdRsi0uVmgQ/values/Arkusz1!A1:B1:append?valueInputOption=RAW"), value, GoogleAccount);
var response = request.GetResponseAsync().Result;
GoogleAccount 是在登录时创建的 Account 对象。
不幸的是,我收到了回复:“Bad Request”:Screenshot from debugger
我认为问题出在 OAuth2Request 的第三个参数(IDictionary 参数),但我不知道如何检查它。 我怎样才能获得更多信息是什么导致了这种反应?
【问题讨论】:
标签: xamarin oauth-2.0 google-sheets-api