0
我试图用C#连接到Onedrive REST API平台,我需要连接的网址是:HTTP邮政Onedrive RESTAPI
“asdfasdfLJLKJLKJK”
和我想要的代码运行是如下:
using System.Net.Http;
using (var client = new HttpClient())
{
var content_new = new FormUrlEncodedContent(new[]{ new KeyValuePair<string, string>("access_token", "asdKJHKJH")});
var content = new FormUrlEncodedContent(values);
client.BaseAddress = new Uri("https://api.onedrive.com/v1.0");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var response_web = await client.PostAsync("/drive", content_new);
var responseString = await response_web.Content.ReadAsStringAsync();
Console.WriteLine(responseString);
Console.ReadLine();}
但它没有一些奇怪的原因,也想知道我是否可以读取PostAsync向服务器发送的数据?我的意思是请求URL,因为这可能也有助于排除故障。
我打电话的地址实际上是:'https://api.onedrive.com/v1.0/drive?access_code="asdf'' – McMilad