【发布时间】:2013-08-21 08:15:49
【问题描述】:
这就是我使用 .NET 调用服务的方式:
var requestedURL = "https://accounts.google.com/o/oauth2/token?code=" + code + "&client_id=" + client_id + "&client_secret=" + client_secret + "&redirect_uri=" + redirect_uri + "&grant_type=authorization_code";
HttpWebRequest authRequest = (HttpWebRequest)WebRequest.Create(requestedURL);
authRequest.ContentType = "application/x-www-form-urlencoded";
authRequest.Method = "POST";
WebResponse authResponseTwitter = authRequest.GetResponse();
但是当这个方法被调用时,我得到:
异常详细信息:System.Net.WebException:远程服务器返回 错误:(411) 需要长度。
我该怎么办?
【问题讨论】:
标签: c# .net httprequest http-status-code-411