首页 新闻 会员 周边

WebRequest访问Google Oauth出现(405) Method Not Allowed错误

0
[已解决问题] 解决于 2012-04-28 22:30

代码如下:

var webRequest = WebRequest.Create("http://accounts.google.com/o/oauth2/token") as HttpWebRequest;
...

运行时出现错误:

The remote server returned an error: (405) Method Not Allowed.

问题补充:

写了一篇博客:

ASP.NET/C# WebRequest POST Google OAuth API

dudu的主页 dudu | 高人七级 | 园豆:31007
提问于:2012-04-28 21:28
< >
分享
最佳答案
0

解决方法:

将 http 改为 https

var webRequest = WebRequest.Create("https://accounts.google.com/o/oauth2/token") as HttpWebRequest;
奖励园豆:5
dudu | 高人七级 |园豆:31007 | 2012-04-28 21:29
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册