I\'m trying to send an image to remote server from nodejs server. Here\'s the request format so far.
Note: Just like binary request in postman and choos
I think you just want this:
fs.createReadStream('./img/thumbnail.png').pipe(https.request({
hostname: 'hostname',
path: '/upload',
method: 'PUT',
headers: {
Accept: 'application/json',
'Content-Type': 'image/png',
}
}, function (response) { ... }));
The issue with your code is that you were putting the body into options.body
, but per the documentation, it doesn't look like there is any such option.