1

我尝试从用户那里获取用户图像配置文件。我使用 jquery 创建 ajax 请求,如下所示:

$.ajax({
  type: "get",
  url: "https://www-opensocial.googleusercontent.com/api/people/myusername/@self",
  contentType: "application/json; charset=utf-8",
  data: {},
  success: function (result) {
    image = result.entry.thumbnailUrl;
    name = result.entry.displayName;
  },
  error: function () {
  }
});

但我收到 405 错误消息。当我从浏览器请求 url 时,我得到了正确的 json 对象。

使用 c# .Net 的解决方案也不错。谢谢你。

4

1 回答 1

0

HTTP 错误 405 说Method not allowed并且您在 Ajax 请求中写了,在您的代码中将type: "get"其替换为。type: "GET"

于 2012-04-01T08:19:02.387 回答