title: sending file from server to server using axios
body: <p>I m trying to post a multi part form data with a file from one api to another. for that I m using axios and a FormData library that handle the data I want to sent</p>
  
  <pre><code>import { ReadStream } from "fs"
  import Axios from "axios"
  import * as fs from "fs"
  const FormData = require('form-data')
  
  let formData: FormData = new FormData()      
  formData.append('name', name)
  formData.append('allowPrint', 'false')
  const file: ReadStream = fs.createReadStream(name)
  formData.append('content', file, name)
  
  return Axios.post(fileAPIUrl + "/file", formData, {
         headers: {
         "Origin": origin,
         "Authorization": "Bearer " + securityToken,
         "Content-Type": "multipart/form-data"
         }, responseType: "json"
  })
  </code></pre>
  
  <p>I should receive a json with the id of my file I just upload. I know the other api works because Is working from my frontend , I m able to post a file with more info from the frontend but if I use this url from my backend I receive the following  error:</p>
  
  <pre><code> { Error: write after end
             at write_ (_http_outgoing.js:627:15)
             at ClientRequest.write (_http_outgoing.js:622:10)
             at RedirectableRequest._write node_modules/follow-redirects/index.js:153:23)
             at doWrite (_stream_writable.js:406:12)
             at clearBuffer (_stream_writable.js:533:7)
             at onwrite (_stream_writable.js:458:7)
             at onCorkedFinish (_stream_writable.js:657:5)
             at afterWrite (_stream_writable.js:473:3)
             at onwrite (_stream_writable.js:464:7)
             at Socket._writeGeneric (net.js:742:5)
             at Socket.connect (net.js:692:12)
             at Object.onceWrapper (events.js:272:13)
             at Socket.emit (events.js:185:15)
             at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1157:10)
           config:
            { adapter: [Function: httpAdapter],
              transformRequest: { '0': [Function: transformRequest] },
              transformResponse: { '0': [Function: transformResponse] },
              timeout: 0,
              xsrfCookieName: 'XSRF-TOKEN',
              xsrfHeaderName: 'X-XSRF-TOKEN',
              maxContentLength: -1,
              validateStatus: [Function: validateStatus],
              headers:
               { Accept: 'application/json, text/plain, */*',
                 'Content-Type': 'multipart/form-data',
                 Origin: 'http://localhost',
                 Authorization: ‘Bearer  token',
                 'User-Agent': 'axios/0.15.3' },
              method: 'post',
              responseType: 'json',
              url: ‘file.url/file',
              data:
               FormData {
                 _overheadLength: 538,
                 _valueLength: 98,
                 _valuesToMeasure: [],
                 writable: false,
                 readable: true,
                 dataSize: 0,
                 maxDataSize: 2097152,
                 pauseStreams: true,
                 _released: true,
                 _streams: [],
                 _currentStream: null,
                 _boundary: '--------------------------207564514352341640400188',
                 _events: {},
                 _eventsCount: 0 } },
           response: undefined }
         (node:89) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
  </code></pre>