【发布时间】:2018-10-17 08:59:07
【问题描述】:
是否可以通过用户位置从 Github Api 获取用户?
下面的代码通过用户名获取用户:
async getUser(user) {
const profileResponse = await fetch(`https://api.github.com/users/${user}?client_id=${this.client_id}&client_secrets=${this.client_secret}`);
const profile = await profileResponse.json();
return {
profile
}
}
我目前正在做一个 Github Api 项目。
【问题讨论】:
-
async getUser(user){ const profileResponse = await fetch(
https://api.github.com/users/${user}?client_id=${this.client_id}&client_secrets=${this.client_secret}); const profile = 等待 profileResponse.json(); return{ profile } } // 该代码在单个用户上获取 -
你试过documentation吗?不是answer your question吗?
标签: git github github-api