title: Node-Red sending the file in http-request node is not working
body: <p>I am trying to send the file with the http-request node but it is not working.</p>
  <p>Please find the following image of Node-red flow.
  <a href="https://i.stack.imgur.com/pD4Tb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pD4Tb.png" alt="enter image description here" /></a></p>
  <p>In the <strong>Request Body</strong> node I have added the following code.</p>
  <pre><code>const inputFile = msg.payload;
  
  const dataJson = 
  {
      'name': 'testName',
      'description':'testdescription',
      'inputfile': inputFile
  };
  msg.payload = dataJson;
  msg.url = 'myAPIurl';
  
  msg.headers = {
      'authorization': 'Bearer TOKEN Here',
      'cookie': 'Cookie here',
      'content-type': 'multipart/form-data;'
  };
  
  return msg;
  </code></pre>
  <p>This is giving bad request error.</p>
  <p>In the <code>Read File</code> node I tried choosing both options <code>A single UTF8-String</code> and <code>a single Buffer Object</code> still I got the same error</p>
  <hr />
  <p>But I tried to call the API inside function node using the request module. It is giving the proper response.</p>
  <pre><code>const request = global.get(&quot;request&quot;);
  const fs = global.get(&quot;fs&quot;);
  
  const url = 'API';
  
  const tkn = 'TOken Here';
  const cookie = 'cookie here';
  
  const fl = fs.createReadStream('/tmp/node-red/app/data/filename.txt');
  var options = {
      method: 'POST',
      url: url,
      headers: {
          'Authorization': tkn,
          'Cookie': cookie,
      },
      formData: {
          &quot;name&quot;: &quot;test121&quot;,
          &quot;description&quot;: &quot;&quot;,
          inputfile: fl
      }
  };
  
  request(options, function (err, resp, body) {
  
      console.log(body);
  
  });
  
  return msg;
  </code></pre>
  <p>I am not sure where I am making the mistake if I use <code>http-request</code> node.</p>