Created
July 23, 2018 12:11
-
-
Save bechampion/72e1dd62657459e44cd466eaf7e6608a to your computer and use it in GitHub Desktop.
popona
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 fileData = fs.createReadStream('evidence.txt'); | |
request.post({ | |
url: 'http://sscs-tribunals-api-demo.service.core-compute-demo.internal/evidence/upload', | |
headers: { | |
'Content-Type': 'multipart/form-data' | |
}, | |
formData: { | |
file: { | |
value: fileData, | |
options: { | |
filename: 'evidence.txt', | |
contentType: 'text/plain' | |
} | |
} | |
} | |
}, function(error,response,body) { | |
console.log(body) | |
console.log(error) | |
console.log(response) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment