I am trying to send PUT request (example at page) using AXIOS.
AXIOS gives me error, but I can successfully execute the command using curl as mentioned below
curl
--header "Content-Type: application/octet-stream"
--request PUT
--data-binary @filename
https://archivist.terraform.io/v1/object/4c44d964-eba7-4dd5-ad29-1ece7b99e8da
This is the Error as given by PUT request with AXIOS
Terraform v0.14.5
Setup failed: failed unpacking terraform config: failed to uncompress slug: gzip: invalid header
My AXIOS code is to upload the file is written below:
res = await axios.put(UPLOAD_URL, { data: fs.readFileSync(UPLOAD_FILE_NAME) }, {
headers: {
"Content-Type": "application/octet-stream"
}
});
if (!(res.status == 201 || res.status==200)) {
console.log("Response header is not 201
", res);
return false;
}
console.log("Configuration version uploaded ...");
} catch (err) {
console.log("Unable to upload the configuration version data file");
console.log(err.message);
return false;
}```
Thank you for the time!!!
question from:
https://stackoverflow.com/questions/65854138/terraform-v0-14-5-setup-failed-failed-unpacking-terraform-config-failed-to-unc 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…