Last active
October 16, 2018 01:06
-
-
Save renderorange/f2a8bd0ffc6eeefe79f13de684631387 to your computer and use it in GitHub Desktop.
propublica GET request via javascript
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 request = require( 'request' ); | |
let options = { | |
url: 'https://api.propublica.org/congress/v1/115/senate/bills/passed.json', | |
headers: { | |
'X-API-Key': 'apikeygoeshere' | |
}, | |
json: true | |
}; | |
request( options, | |
function( err, res, json ) { | |
if ( err ) | |
throw new Error( err ); | |
console.log( JSON.stringify( json ) ); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment