title: Convert HttpContent into byte[]
body: <p>I am currently working on a c# web API. For a specific call I need to send 2 images using an ajax call to the API, so that the API can save them as varbinary(max) in the database.</p>
  
  <ol>
  <li>How do you extract an <code>Image</code> or <code>byte[]</code> from a <code>HttpContent</code> object?</li>
  <li>How do I do this twice? Once for each image.</li>
  </ol>
  
  <p>-</p>
  
  <pre><code>var authToken = $("#AuthToken").val();
  var formData = new FormData($('form')[0]);
  debugger;
  $.ajax({
      url: "/api/obj/Create/", 
      headers: { "Authorization-Token": authToken },
      type: 'POST',
      xhr: function () { 
          var myXhr = $.ajaxSettings.xhr();
          return myXhr;
      },
      data: formData,
      cache: false,
      contentType: false,
      processData: false
  });
  </code></pre>
  
  <p>-</p>
  
  <pre><code>public async Task&lt;int&gt; Create(HttpContent content)
  {
      if (!content.IsMimeMultipartContent())
      {
          throw new UnsupportedMediaTypeException("MIME Multipart Content is not supported");
      }
  
      return 3;
  }
  </code></pre>