Created
April 17, 2019 07:39
-
-
Save chukonu/82d8f38aa71e33e62ce8e122123b9725 to your computer and use it in GitHub Desktop.
HTTP request w/ p12
This file contains hidden or 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 fs = require('fs'); | |
const path = require('path'); | |
const request = require('request'); | |
const opts = { | |
url: '', | |
qs: { | |
}, | |
headers: { | |
'content-type': 'application/json', | |
}, | |
agentOptions: { | |
pfx: fs.readFileSync(path.resolve(__dirname, '')), | |
passphrase: '', | |
}, | |
}; | |
request.get(opts, (err, resp, body) => { | |
if (err) { | |
console.error(err); | |
return; | |
} | |
fs.writeFileSync(path.resolve(__dirname, ''), body); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment