我尝试从用户那里获取用户图像配置文件。我使用 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 的解决方案也不错。谢谢你。