问题描述
我已经能够通过下面的API检索除联系人照片之外的所有内容。
I've been able to retrieve everything but the contacts photo by following the API.
我可以从img url获得img url以及gd:etag xml返回。下面是Google API的例子,它和我得到的是同样的东西,当然我的联系人的属性值不同。
I can get the img url as well as the gd:etag from the xml returned. Below is the Google API example, and it is the same thing I get, with the value of the attributes being different of course for my contacts.
<link rel='http://schemas.google.com/contacts/2008/rel#photo' type='image/*'
href='https://www.google.com/m8/feeds/photos/media/liz%40gmail.com/c9012de'
gd:etag='"KTlcZWs1bCp7ImBBPV43VUV4LXEZCXERZAc."'>
问题是我不知道如何显示它。当我尝试它时,我只是得到了url的最后部分(即:/ 32432eewqdweq),没有图像。
The problem is I don't know how to get it to display. When I try it, I just get the last part of the url (ie: "/32432eewqdweq") and no image.
我使用rails,这是我的第二周进行网络开发,很抱歉,如果我看起来没什么意思啊。
I'm using rails, and this is my second week of doing web development, sorry if I seem noobish aha.
任何帮助将不胜感激!
感谢,
Goran
推荐答案
请求url,还包括access_token作为查询参数。
You would need to make a request to the url, but also include the access_token as a query parameter.
因此,使用你的例子,假设你的access_token是ABCDEF123456ABCDEF,那么你想要的GET请求是:
So, using your example, let's say if your access_token is ABCDEF123456ABCDEF, then the GET request you want to make is:
这篇关于Google API:获取联系人照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!