Skip to content

Instantly share code, notes, and snippets.

@kevinsawicki
Created May 18, 2011 00:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kevinsawicki/977763 to your computer and use it in GitHub Desktop.
Save kevinsawicki/977763 to your computer and use it in GitHub Desktop.
Create Gists using the GitHub v3 Java API
GitHubClient client = new GitHubClient().setCredentials("user", "p4ssw0rd");
Gist gist = new Gist().setDescription("Prints a string to standard out");
GistFile file = new GistFile().setContent("System.out.println(\"Hello World\");");
gist.setFiles(Collections.singletonMap("Hello.java", file));
gist = new GistService(client).createGist(gist);
@ttpro1995
Copy link

which package does GitHubClient in ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment