这是我的代码:
var client = new WebClient();
client.Headers[HttpRequestHeader.Authorization] = "Basic " + "SECRETCODE";
client.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded; charset=UTF-8";
client.Headers[HttpRequestHeader.Host] = "api.quizlet.com";
client.UploadStringCompleted += ClientOnUploadStringCompleted;
client.UploadStringAsync(new Uri("https://api.quizlet.com/oauth/token"), "POST", string.Format("grant_type={0}&code={1}&redirect_uri={2}",
HttpUtility.HtmlEncode("authorization_code"), HttpUtility.HtmlEncode(code), HttpUtility.HtmlEncode(AfterOAuthUrl)));
当我在 WinForms 中测试此代码时,我收到了正确的令牌,但是当我在 WP7 上使用它时,它抛出异常:远程服务器返回:“未找到”。我应该怎么办?这是 WP 证书问题,还是我必须在 WP7 上做一些不同的事情?