我正在使用 Github 的 API 来使用 https://api.github.com/user 获取用户,给我这样的信息:
{
"login": "someuser123",
"id": 1234567,
"avatar_url": "https://avatars.githubusercontent.com/u/...",
...
}
但是 id
字段的数据类型是什么?我似乎在 API 指南中找不到任何相关信息。
最佳答案
在 Octokit.net codebase 中发现了一些 C# 内容这似乎表明 User id 是一个 32 位整数。从 User 构造函数(id 埋在参数列表的中间):
public User(string avatarUrl, string bio, string blog, int collaborators, string company, DateTimeOffset createdAt, int diskUsage, string email, int followers, int following, bool? hireable, string htmlUrl, int totalPrivateRepos, int id, string location, string login, string name, int ownedPrivateRepos, Plan plan, int privateGists, int publicGists, int publicRepos, string url, bool siteAdmin)
关于github - Github 用户 ID 的数据类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34578145/