Linkedin API-图片网址::原始-禁止403错误 [英] Linkedin API - Picture-urls::original - forbidden 403 error
问题描述
当我使用LinkedIn API获取个人资料信息时,有时无法访问图片网址.
When i use the LinkedIn API to get profile information, the picture urls are sometime not accessible.
我得到这个答复
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>403 - Forbidden</title>
</head>
<body>
<h1>403 - Forbidden</h1>
</body>
</html>
进一步挖掘后发现,LinkedIn对于原始图片网址返回了类似的内容
Upon further digging I find that LinkedIn returns something like this for original picture url
.../profile-originalphoto-shrink_900_1200 ...
.../profile-originalphoto-shrink_900_1200...
但是,当我访问LinkedIn.com并查看个人资料图片的网址时,它看起来像这样
However, when I go to LinkedIn.com and checkout the URL of the picture of the profile it looks something like this
.../profile-originalphoto-shrink_800_800 ...
.../profile-originalphoto-shrink_800_800...
还有其他人遇到这个问题吗?这是怎么回事?
Does anyone else face this issue? What is going on here?
我还验证了我使用的是正确的范围"r_basicprofile"
I also verified that I'm using the correct scope "r_basicprofile"
推荐答案
您可以请求调整大小的图片URL,而不是请求原始的图片URL.例如
Rather than requesting the original picture-url, you can make a request to a resized picture-url. For example,
picture-url;size=400
大小可以是100、200或400.
where size can be 100, 200, or 400.
这篇关于Linkedin API-图片网址::原始-禁止403错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!