node js post multipart/form-data
var jsonUpload = { };
var formData = {
'file': fs.createReadStream(fileName),
'jsonUpload': JSON.stringify(jsonUpload)
};
var uploadOptions = {
"url": "https://upload/url",
"method": "POST",
"headers": {
"Authorization": "Bearer " + accessToken
},
"formData": formData
}
var req = request(uploadOptions, function(err, resp, body) {
if (err) {
console.log('Error ', err);
} else {
console.log('upload successful', body)
}
});
Also in JavaScript:
- find year javascript
- how to count occurences in an array with javascript
- encrypt script code
- javascript switch statement multiple cases
- add firebase javascript
- jquery do something if toggle open and close
- Syntax Error: Thread Loader (Worker 0) .eslintrc.js: Environment key "es2021" is unknown at Array.forEach (<anonymous>)
- document.addEventListener("backbutton
- how to run resize event only on client side angular
- javascript fastest loop
- vue-sfc-rollup external dependency
- useeffect cleanup function
- emit resize event in angular
- <FilterProvider> errorr
- how do i pair of socks in an array javascript
- loop in javascript
- nextjs starter template with auth
- d3js circle out of scrren
- datepicker in react
- angular usehash not working
- js tan-1
- user input through js
- js check if variable is string
- libuv nodejs