Created
November 3, 2017 10:30
-
-
Save d00rman/1d5309cb112494b0b247884f8e552d09 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
'use strict'; | |
const preq = require('preq'); | |
return preq.post({ | |
uri: 'https://en.wikipedia.org/w/api.php', | |
headers: { | |
'content-type': 'application/json' | |
}, | |
body: { | |
action: 'query', | |
prop: 'info|revisions', | |
titles: 'Foobar', | |
format: 'json', | |
formatversion: 2 | |
} | |
}) | |
.then((res) => { | |
console.log(res.status); | |
console.log(JSON.stringify(res.headers, null, 2)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment