Last active
January 14, 2019 17:47
-
-
Save KonnorRogers/6a26350749bd890789f1271bbb847114 to your computer and use it in GitHub Desktop.
GitHub API v4 requests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For forming a github v4 API request via Net::HTTP | |
# load the library, it will auto require the uri library | |
require 'net/http' | |
# githubs api url | |
endpoint_url = 'https://api.github.com/graphql' | |
# json formatted graphql request | |
# taken from docs - api v4 | |
# NOT FINISHED | |
graphql_request = { query { | |
repository(owner: "ParamagicDev", name: "vps_setup") | |
} | |
}.to_json | |
# all graphql requests are post requests unless introspective requests | |
Net::HTTP.post( | |
URI(endpoint_url, graphql_request) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment