我试过使用 jcabi-github 以下是我的代码
Github github = new RtGithub("<Oauth token>");
Iterable<Repo> repo = github.repos().iterate("");
for (Repo repo2 : repo) {
System.out.println(repo2);
}
但是这是报错
{"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}>
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
我正在尝试连接到我公司的 git hub 帐户,即 https://github.corp.xyz.com/
有什么帮助吗?
最佳答案
我是通过使用 https://github.com/kohsuke/github-api 完成的
下面是供以后引用的代码:
GitHub github = GitHub.connectToEnterprise(
"https://github.corp.<abc>.com/api/v3",
"<Oauth token>");
GHContentSearchBuilder search = github.searchContent();
GHContentSearchBuilder s = search.q(<searchkeyword>);
关于java - 如何使用 java 连接到我公司的 git hub 门户?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31509029/