Last active
September 26, 2020 14:54
-
-
Save rmela/d24c211e5588ff919bb8d00d3566b592 to your computer and use it in GitHub Desktop.
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
curl --header "Authorization: bearer <your-github-api-token-here>" https://api.github.com/graphql \ | |
-d '{"query":"query { viewer { login } }"}' |
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
const https = require( "https" ) | |
const TOKEN="<your-github-token-here>" | |
const QUERY = JSON.stringify( {query: "query { viewer { login }}"} ) | |
const OPTIONS = { | |
method: "POST", | |
hostname: "api.github.com", | |
path: "/graphql", | |
headers: { | |
"Authorization":`bearer ${TOKEN}`, | |
"User-Agent":"Rob-O-Matic 3000", | |
"Content-Length": QUERY.length | |
} | |
} | |
https | |
.request( OPTIONS, res => res.pipe(process.stdout) ) | |
.write( QUERY ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment