Skip to content

Instantly share code, notes, and snippets.

@bhipple
Last active February 17, 2016 23:34
Show Gist options
  • Save bhipple/9e0a3ddad6a4c74e9e11 to your computer and use it in GitHub Desktop.
Save bhipple/9e0a3ddad6a4c74e9e11 to your computer and use it in GitHub Desktop.

curl

This thing is awesome. Writing down here to note the syntax of how to send a JSON request to a REST API:

curl -u bhipple:$TOKEN -H "Content-Type: application/json" -X PATCH -d '{"location":"cmdline"}' "https://api.github.com/user"

Changes the location of the user to "cmdline" using this API.

Some useful REST endpoints on the GitHub API:

Click the merge button:
https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button

The comment stream:
https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue

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