title: Angular 7 Post file contents as multipart/form-data
body: <p>I have the content I want to POST available in a string variable.
  I want to use: </p>
  
  <pre><code>import { HttpClient } from '@angular/common/http'
  </code></pre>
  
  <p>... in order to accomplish the same effect as: </p>
  
  <pre><code>curl -F "image=@blob.bin" someurl.com
  </code></pre>
  
  <p>... where the contents of my string variable would be what might be in a local file called `blob.bin. I'm not sure how to do it, but this <em>doesn't</em> work:</p>
  
  <pre><code>this.http.post('http://someurl.com', fileContents)
  </code></pre>
  
  <p>How do you get this effect using Angular 7 and the HttpClient service? I don't have an actual HTML form that I'm interacting with, I just have some prescribed binary / string content that I need to post <em>as though</em> it was submitted by a form that looks like (which is the same as what the curl above does):</p>
  
  <pre><code>&lt;form method='POST' action='http://someurl.com' enctype='multipart/form-data'&gt;
    &lt;input type='file' name='update'&gt;
    &lt;input type='submit' value='Update'&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I'm sure it can be achieved, just having trouble performing the right incantations.</p>