Created
July 23, 2018 12:03
-
-
Save bechampion/3ab1aa16e42e5daeb8e9f5583856718e 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 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