Skip to content

Instantly share code, notes, and snippets.

@bechampion
Created July 23, 2018 12:03
Show Gist options
  • Save bechampion/3ab1aa16e42e5daeb8e9f5583856718e to your computer and use it in GitHub Desktop.
Save bechampion/3ab1aa16e42e5daeb8e9f5583856718e to your computer and use it in GitHub Desktop.
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'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment