从Google+ API检索个人资料图片 [英] Retrieving profile image from Google+ API

查看:90
本文介绍了从Google+ API检索个人资料图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Google+ API中提取JSON数据.当我包括图像属性时,图像的大小设置为50px.如何更改图像尺寸?我没有在文档中看到它.

I am trying to pull JSON data from Google+ API. When I include the image attribute size of the image is set to 50px. How do I change the image size? I don't see it on the docs.

获取 https://www .googleapis.com/plus/v1/people/100300281975626912157?fields = image& key = {YOUR_API_KEY}

响应

{
 "image": {
  "url": "https://lh3.googleusercontent.com/-U353P5vNuRE/AAAAAAAAAAI/AAAAAAAABKM/a7U7bq251x0/photo.jpg?sz=50"
 }
}

推荐答案

URL字符串的末尾有一个名为sz = 50

At the end of your URL string there's a attribute called sz=50

我只是尝试更改属性,结果图像的大小也随之更改.

I just tried to change the attribute, and as result the image's size is changed aswell.

尝试以下两个网址:

https://lh3.googleusercontent. com/-U353P5vNuRE/AAAAAAAAAAI/AAAAAAAABKM/a7U7bq251x0/photo.jpg?sz = 50

https://lh3.googleusercontent. com/-U353P5vNuRE/AAAAAAAAAAI/AAAAAAAABKM/a7U7bq251x0/photo.jpg?sz = 150

看到区别了吗?

这篇关于从Google+ API检索个人资料图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆