有ASP.NET 4.0
使用的应用程序Facebook API
。它工作正常,直到上周。当我尝试为我的应用程序获取访问令牌时
public static string GetWebResponse_HttpWebRequest(string url)
{
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
request.Method = "GET";
WebResponse webResponse;
string response = "";
webResponse = request.GetResponse();
io.Stream stream = webResponse.GetResponseStream();
io.StreamReader str = new io.StreamReader(stream);
response = str.ReadToEnd();
return response;
}
url: https://graph.facebook.com/oauth/access_token?client_id=117260348353246&client_secret=7b8734d7f36bf007d0d40bec728b57d9&code=AQD5xcdQiE2Ab9RpmexVUdP-i_2Nm5V52SVhxBVXkeq7WlJoOQ-xB4wYgbs3yeejLFHmR-lKLj0cwg6FeMWKGvHwT4akAlN7uMLxqu9YaqFumup3SPkuTjuQYETTCqQ1n2MAQjzexqiv8WV3UEcO4Qy5lObQ13qdYlKoYdKUacT42oJ0vhVuopH2WNkk3QRCq6DeAl02YU-sD8X8PTZgu52e&redirect_uri=http://www.opinere.com
有一个错误:
{"error":{"message":"Code was invalid or expired. The session was invalidated explicitly using an API call.","type":"OAuthException","code":100}}
在我的本地机器上,应用程序正常工作。Windows Azure
有时它会起作用,但大多数情况下不会。
怎么了?
更新:有两个请求:1)没有错误 2)一分钟后有错误- Code2(访问令牌)是空的,似乎不同之处在于标题“HTTP_REFERER”。在第二个请求中不存在。