title: POST binary data from browser to JFrog / Artifactory server without using form-data
body: <p>So we get a file (an image file) in the front-end like so:</p>
  
  <p>//html</p>
  
  <pre><code>  &lt;input type="file" ng-change="onFileChange"&gt;
  </code></pre>
  
  <p>//javascript</p>
  
  <pre><code>  $scope.onFileChange = function (e) {
        e.preventDefault();
        let file = e.target.files[0];
        // I presume this is just a binary file
        // I want to HTTP Post this file to a server
        // without using form-data
     };
  </code></pre>
  
  <p>What I want to know is - is there a way to POST this file to a server, without including the file as form-data? The problem is that the server I am send a HTTP POST request to, doesn't really know how to store form-data when it receives a request.</p>
  
  <p>I believe this is the right way to do it, but I am not sure.</p>
  
  <pre><code>  fetch('www.example.net', { // Your POST endpoint
      method: 'POST',
      headers: {
        "Content-Type": "image/jpeg"
      },
      body: e.target.files[0] // the file
    })
     .then(
      response =&gt; response.json() // if the response is a JSON object
    )
  </code></pre>