[英]GitHub API returned Url meaning
Take this very simple API as example,以这个非常简单的 API 为例,
https://api.github.com/users/zhuhuihuihui https://api.github.com/users/zhuhuihuihui
In the JSON formatted response, you'll find something like following,在 JSON 格式的响应中,您会发现如下内容,
"following_url":"https://api.github.com/users/zhuhuihuihui/following
{/other_user}
",
"following_url":"https://api.github.com/users/zhuhuihuihui/following
{/other_user}
",
"gists_url": "https://api.github.com/users/zhuhuihuihui/gists
{/gist_id}
",
"gists_url": "https://api.github.com/users/zhuhuihuihui/gists
{/gist_id}
",
"starred_url": "https://api.github.com/users/zhuhuihuihui/starred
{/owner}{/repo}"
,
"starred_url": "https://api.github.com/users/zhuhuihuihui/starred
{/owner}{/repo}"
,
Ok, I know like the following_url
, starred_url
is something like a sub API which you can call to fetch who that user are following, or what repos that user has starred.好的,我知道像
following_url
, starred_url
类似于一个子 API,您可以调用它来获取该用户关注的人,或者该用户已加星标的存储库。
But, what does those braces mean?但是,这些大括号是什么意思? The one I've made it Bold .
我把它变成了Bold 。 How do I use them?
我如何使用它们?
Those are placeholders value, that you would need to replace by an actual value in order to use those links.这些是占位符值,您需要将其替换为实际值才能使用这些链接。
It serves to remind a user how to access, for instance, the following_url for another user.它用于提醒用户如何访问,例如,另一个用户的 following_url。
without {/other_user}
, that url https://api.github.com/users/zhuhuihuihui/following would list all users followed.没有
{/other_user}
,该网址https://api.github.com/users/zhuhuihuihui/following将列出所有关注的用户。
with {/other_user}
, that url https://api.github.com/users/zhuhuihuihui/following/xxx would check if you follow user xxx
.使用
{/other_user}
,该网址https://api.github.com/users/zhuhuihuihui/following/xxx将检查您是否关注用户xxx
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.