with node.js, how to post image (take it from some url) to server API?
<p>I'm trying to get image url, and then post it somehow(either with FormData)...
I've found some usefull info here 
<a href="https://github.com/request/request/issues/1605" rel="nofollow noreferrer">1</a>, <a href="https://github.com/request/request/issues/316" rel="nofollow noreferrer">2</a>, <a href="https://stackoverflow.com/questions/13797670/nodejs-post-request-multipart-form-data">3</a> ... 
I've tried several variants of code. but still cant' load image to server.
My code now :</p>

<pre><code>var FormData = require('form-data');
var request = require('request');

      var form = new FormData();
         request.get(url, {encoding:null}, function (error, response, body) {

             form.append('my_logo', body);
             form.getLength(function(err,length){
                 console.log(length);
                 var r = request.post(upload_url, { headers: { 'content-length': length } }, function(err, httpResponse, body) {

                     if (err) console.log(+err)
                         var res = (typeof body == 'string') ? JSON.parse(body) : body;
                     console.log(res);

                 })
                 r._form = form
             });
         })
</code></pre>

<p>in response from Post request i receive information, that loaded undefined... 
I use request and form-data library... 
How could i do that right?
Maybe with native node.js code  it will be better?</p>