title: Node-Red POST multipart/form-data (http request)
body: <p>I would like to POST two data in multipart / form-data format using Node-RED.<br>
  (One for text data, one for voice data)<br>
  I set the function node and http request node as follows, but it does not seem to be POST.</p>
  
  <p>I think that it is necessary to create a multi-part body and assign it to msg.body, but I do not know how to create a multi-part body of the voice data.<br>
  I do not know how to solve it, so someone would like to tell me.</p>
  
  <h3>function node</h3>
  
  <pre><code>var request = global.get('requestModule');
  var fs = global.get('fsModule');
  msg.body = {};
  msg.body = {
      'apikey' : "**********",
      'wav' : fs.createReadStream('/tmp/testtest.wav')
  };
  
  msg.headers = {};
  msg.headers['Content-type'] = 'multipart/form-data';
  
  return msg
  </code></pre>
  
  <h3>http request(Property)</h3>
  
  <p><img src="https://i.stack.imgur.com/EYDIJ.png" alt="http request node pic installed by default"> </p>
  
  <p><img src="https://i.stack.imgur.com/Ut3Kr.png" alt="http request node property pic">  </p>
  
  <p>method ⇒ POST<br>
  URL ⇒ <a href="https://xxxxyyyzzz/" rel="nofollow noreferrer">https://xxxxyyyzzz/</a><br>
  SSL/TLS ⇒ No<br>
  Basic ⇒ No<br>
  Output ⇒ JSON</p>