Created
November 13, 2018 02:32
-
-
Save kodamirmo/cb22d90979c0962e83d5808a78f3e300 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
const request = require('request'); | |
const fs = require('fs'); | |
const formData = { | |
w: 'fileUploader', | |
r: 'subir_certif', | |
sessionKey: 'jkasdutsvafu76arfs7d5c7v', | |
iam : 'nvm2391', | |
my_file: fs.createReadStream('/ruta/test.p12'), | |
}; | |
request.post({url:'https://api-demo.crlibre.org/api.php', formData: formData}, function optionalCallback(err, httpResponse, body) { | |
if (err) { | |
return console.error('upload failed:', err); | |
} | |
console.log('Upload successful! Server responded with:', body); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment