title: Posting a multipart form with file in Axios, Nodejs
body: <pre><code>const form_data = new FormData();
  form_data.append("File", fs.createReadStream(pathToFile));
  form_data.append('Login', alias.toUpperCase());
  
  const request_config = {
      headers: {
          "Authorization": "Basic 123",
          "Content-Type": 'multipart/form-data'
      },
      data: form_data
  };
  
  await axios.post(url, params, request_config).then(response =&gt; {
  </code></pre>
  
  <p>Posting to an endpoint I can't debug. The response is a 500.</p>
  
  <p>This is the error:</p>
  
  <p><a href="https://i.stack.imgur.com/DYwb1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DYwb1.png" alt="enter image description here"></a></p>
  
  <p>Is this the correct way do it? </p>
  
  <p>Can I somehow see exactly what Axios is sending?</p>
  
  <p>This is a postman request I received from the author of the API. This passes:</p>
  
  <pre><code>POST /api/upload HTTP/1.1
  
  Host: api.test.contoso.se
  
  Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
  
  Authorization: Basic 123
  
  User-Agent: PostmanRuntime/7.13.0
  
  Accept: */*
  
  Cache-Control: no-cache
  
  Postman-Token: 089af753-fa12-46c4-326f-dfc39c36faab,c5977145-ece3-4b53-93ff-057788eb0dcf
  
  Host: api.test.contoso.se
  
  accept-encoding: gzip, deflate
  
  content-length: 18354
  
  Connection: keep-alive
  
  cache-control: no-cache
  
  Content-Disposition: form-data; name="Lang"
  
  SV
  ------WebKitFormBoundary7MA4YWxkTrZu0gW--
  
  Content-Disposition: form-data; name="File"; filename="/C:/Users/file.docx
  
  
  ------WebKitFormBoundary7MA4YWxkTrZu0gW--
  
  Content-Disposition: form-data; name="Login"
  
  ABC
  </code></pre>