我尝试从pushpullet API获取设备列表
我正在使用此代码
string api = "my api key";
string url = "https://" + api + ":@api.pushbullet.com/v2/devices";
Uri uri = new Uri(url);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.Method = "GET";
string result = string.Empty;
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
using (Stream responseStream = response.GetResponseStream())
{
using (StreamReader readStream = new StreamReader(responseStream, Encoding.UTF8))
{
result = readStream.ReadToEnd();
}
}
}
我得到401"没有提供有效的API密钥。"
当我在postman
上试用时它的工作正常,我收到了回复。pushbullet api