前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >github获取uid方式

github获取uid方式

作者头像
阿超
发布2024-04-16 09:23:23
870
发布2024-04-16 09:23:23
举报
文章被收录于专栏:快乐阿超快乐阿超

不要在已成的事业中逗留着。——巴斯德

首先方式是:

代码语言:javascript
复制
https://api.github.com/users/VampireAchao

例如我访问得到:

代码语言:javascript
复制
{
  "login": "VampireAchao",
  "id": 52746628,
  "node_id": "MDQ6VXNlcjUyNzQ2NjI4",
  "avatar_url": "https://avatars.githubusercontent.com/u/52746628?v=4",
  "gravatar_id": "",
  "url": "https://api.github.com/users/VampireAchao",
  "html_url": "https://github.com/VampireAchao",
  "followers_url": "https://api.github.com/users/VampireAchao/followers",
  "following_url": "https://api.github.com/users/VampireAchao/following{/other_user}",
  "gists_url": "https://api.github.com/users/VampireAchao/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/VampireAchao/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/VampireAchao/subscriptions",
  "organizations_url": "https://api.github.com/users/VampireAchao/orgs",
  "repos_url": "https://api.github.com/users/VampireAchao/repos",
  "events_url": "https://api.github.com/users/VampireAchao/events{/privacy}",
  "received_events_url": "https://api.github.com/users/VampireAchao/received_events",
  "type": "User",
  "site_admin": false,
  "name": "VampireAchao",
  "company": "@apache @dromara @baomidou ",
  "blog": "https://vampireachao.github.io/",
  "location": "Beijing",
  "email": null,
  "hireable": null,
  "bio": "Cover Person of Gitee、Dromara-Stream-Query Author、Dromara-Hutool、Baomidou-Mybatis-Plus Team Member、Apache StreamPark Committer,Apache Shenyu  Contributor",
  "twitter_username": "VampireAchao",
  "public_repos": 83,
  "public_gists": 1,
  "followers": 75,
  "following": 183,
  "created_at": "2019-07-10T12:22:27Z",
  "updated_at": "2024-03-29T06:35:39Z"
}

这里的id就是uid

GitHub REST API文档地址:

GitHub REST API 文档 - GitHub 文档

用户的 REST API 终结点 - GitHub 文档

代码语言:javascript
复制
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/user

对应的状态码说明

“Get the authenticated user”的 HTTP 响应状态代码

状态代码

说明

200

OK

304

Not modified

401

Requires authentication

403

Forbidden

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2024-04-15,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • “Get the authenticated user”的 HTTP 响应状态代码
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档