請幫助!想不通爲什麼通過MSDN給出的這個簡單的代碼不工作....Windows推送通知返回錯誤請求400
我使用作爲this MSDN article給獲得訪問令牌GetAccessToken()下面的代碼在Windows中使用通知,但它返回「無效請求400」時,應用程序與Windows應用商店儀表板
string urlEncodedSid = HttpUtility.UrlEncode(PACKAGE_SECURITY_IDENTIFIER);
string urlEncodedSecret = HttpUtility.UrlEncode(CLIENT_SECRET);
string body = String.Format("grant_type=client_credentials&client_id={0}&client_secret={1}&scope=notify.windows.com", urlEncodedSid, urlEncodedSecret);
string response;
using (WebClient client = new WebClient())
{
client.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
response = client.UploadString("https://login.live.com/accesstoken.srf", body);
}
任何幫助,將不勝感激註冊獲得
PACKAGE_SECURITY_IDENTIFIER,CLIENT_SECRET值...... 。
[Fetching AccessToken返回「400 - Bad Request」用於通過WNS驗證雲服務](http://stackoverflow.com/questions/15105405/fetching-accesstoken-returns-400-bad-request-for-認證,雲服務) – 2013-03-20 20:41:08
@ConradFrix - 嗯我投票結束你關聯的問題。我們不應該關閉它們兩個! – 2013-03-20 22:01:04