【发布时间】:2020-05-08 17:32:01
【问题描述】:
我想获取其他用户当前播放曲目的数据。可能吗 ?我可以自己带。
using (var hc = new HttpClient())
{
hc.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "my token");
using (var music = await hc.GetAsync($"https://api.spotify.com/v1/me/player/currently-playing"))
{
music.EnsureSuccessStatusCode();
string jsonString = await music.Content.ReadAsStringAsync();
// TODO: parse json and return true, if the returned array contains the stream
JObject o = JObject.Parse(jsonString);
}
}
【问题讨论】: