如何在WP 8编程中获得Sound Clound中的曲目列表?

时间:2014-04-29 00:52:05

标签: soundcloud

我是WP编程的初学者。我的第一个应用程序是关于SoundCloud的,我正在尝试使用HttpRequestMessage获取一个轨道列表,但响应消息是"未找到"。

我不知道为什么当我在网站浏览器中输入这个URI时,我得到了我需要的字符串。

我的代码是:

private async Task<string> GetMyTracks(string id)
{
        HttpClient client = new HttpClient();
        HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Put, string.Format(
             "https://api.soundcloud.com/users/{0}/tracks.json", id));
        string tokenqrq = string.Format(
            "client_id={0}",app.ClientID);
        request.Content = new StringContent(tokenqrq, Encoding.UTF8, "application/x-www-form-urlencoded");
        HttpResponseMessage response = await client.SendAsync(request);
        string responseString = await response.Content.ReadAsStringAsync();
        return responseString;
}

0 个答案:

没有答案