title: Angular8 http client form data upload
body: <p>I'm trying to upload files using the http client and I'm always getting a bad response from the backend. I'm assuming that the problem resides on the request, because apart from that, everything that my request has is exacly the same as the request I am making on aurelia http client. </p>
  
  <p>In general here some information about the request headers from angular:</p>
  
  <pre><code>Request URL: https://*/document/document?name=ecv_template_en.pdf&amp;classification=0
  Request Method: POST
  Content-Type: application/json
  Request payload:
  ------WebKitFormBoundary1gYAP6XB8f1TQ7RP
  Content-Disposition: form-data; name="blobFile"; filename="ecv_template_en.pdf"
  Content-Type: application/pdf
  ------WebKitFormBoundary1gYAP6XB8f1TQ7RP--
  </code></pre>
  
  <p>And the same request from aurelia http client:</p>
  
  <pre><code>Request URL: https://*/document/document?name=ecv_template_en.pdf&amp;classification=0
  Request Method: POST
  Content-Type: multipart/form-data; boundary=----WebKitFormBoundarydb5u93415NsBfKEz
  </code></pre>
  
  <p>Now there isn't a request payload but a form data with a <code>blobFile: (binary)</code></p>
  
  <p>This is the angular code that I'm doing in order to reproduce the call:</p>
  
  <pre><code>const formData = new FormData();
  formData.append("blobFile", documentUpload.file);
  return this.http
      .post(`${*}/document?name=${name}&amp;classification=${classification}`, 
       formData).pipe(
          map(do stuff))
      );
  </code></pre>
  
  <p>I've also checked the content of the formData and it's exacly the same both on aurelia request and angular request. </p>
  
  <p><a href="https://i.stack.imgur.com/BdyB5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BdyB5.jpg" alt="aurelia request"></a></p>
  
  <p><a href="https://i.stack.imgur.com/AJDrK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AJDrK.png" alt="angular"></a></p>
  
  <p>Also the endpoint that I'm calling is the following:</p>
  
  <pre><code>    [HttpPost()]
      public ActionResult Create([FromForm]IFormFile blobFile,
          [FromQuery] string name,
          [FromQuery] ClassificationType classification)
  </code></pre>