Im trying to make an http request , using the example :
function decodeVIN (VIN){
// Output value. Initially set to an empty string (XLSForm null)
let outValue = "";
// Check the length to make sure a full VIN is provided
if (VIN.length<11){
return outValue;
}
// Add the VIN to the decode VIN API request
let url = `https://vpic.nhtsa.dot.gov/api/vehicles/decodevinvalues/${VIN}?format=json`;
// Create the request object
let xhr = new XMLHttpRequest();
// Make the request. Note the 3rd parameter, which makes this a synchronous request
xhr.open("GET", url, false);
xhr.send();
if (xhr.status !== 200) {
} else {
outValue = xhr.responseText;
}
return outValue;
}
But my i want to make an request that send an binary file in pdf end wait for a response. Anyone know how to do that?