title: How to put binary file to API via AngularJs $http
body: <p>I want to upload a binary file (images) to an api which accepts <code>application/octet-stream</code>. Unfortunately it seems angular wants to transform my request, which does not work obviously and results in
  <code>TypeError: key.charAt is not a function
  </code></p>
  
  <p>My request looks like this:</p>
  
  <pre><code>var f = document.getElementById('file_picker').files[0],
  r = new FileReader();
  r.onloadend = function(e){
      var fileData = e.target.result;
      $http({
          url: '.../upload/' + id,
          method: 'PUT', 
          headers: {'Authorization': 'Bearer asdf',
          'Content-Type': 'application/octet-stream'}, 
          data: new Uint8Array(fileData), 
          transformRequest: []
      })
  })
  r.readAsArrayBuffer(f);
  </code></pre>
  
  <p>This is my request via curl which works:</p>
  
  <pre><code>curl -i -X PUT -H "Authorization: Bearer asdf" -H "Content-Type: application/octet-stream" --data-binary @jpg.jpg https://.../upload/123
  </code></pre>
  
  <p>Any ideas? Thanks.</p>