简体   繁体   中英

What are the requirements to connect GitHub by using GitHub api and java

I want to connect to GitHub by using GitHub api and java.Do i need to do that application as WEB-Application or standalone app

can any one please tell me what are the requirements for that

if possible please provide me sample application to connect GitHub

You may connect to the GitHub API using a standalone application or a web application.

You will need to first register your application with GitHub to obtain your credentials which are used to login when accessing the API. This can be done by creating an application within your user profile on GitHub.

Once you have your credentials I would recommend using an existing library to access the API. I have successfully used the GitHub Java API .

If you want to see an example of how to login with the API see the source code for my blog here .

You can use jcabi-github (I'm one of its developers):

Github github = new RtGithub("user", "password");

Now you have a client that can help you to manipulate Github entities, for example you can list all issues in a given repository:

Coordinates coords = new Coordinates.Simple("jcabi/jcabi-github");
Repo repo = github.repos().get(coords);
for (Issue issue : repo.issues().iterate(Collections.<String, String>emptyMap())) {
  System.out.println("Issue found: #" + issue.number());
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM