JavaScript to Postman
Does anyone know how to translate this javascript function to Postiman?
(the code is from this document
Document 2720570.1 (oracle.com)
)
function uploadFile(file) {
var url = 'http://<AIS_Host>:<Port>/jderest/file/upload';
var xhr = new XMLHttpRequest();
var formData = new FormData();
xhr.open('POST', url, true);
xhr.setRequestHeader('Accept', 'application/json');
const moAdd =
{
username: "<User>",
password: "<Password>",
deviceName: "MyDevice",
ssoEnabled: false,
moStructure: "ABGT",
moKey:[
"939364"
],
formName: "P01012_W01012B",
version: "ZJDE0001",
file:{
fileName: "test.txt",
fileLocation: "C:\\test.txt",
itemName: "Test1",
sequence: 0
}
};
const json = JSON.stringify(moAdd);
formData.append('moAdd', new Blob([json], {type: "application/json"}));
formData.append('file', file);
xhr.onreadystatechange = function ()