title: AngularJS - Open or forward $http.post application/octet-stream javascript response
body: <p>In my AngularJS application I have to request via HTTP POST for a pdf report.
  The response is an application/octet-stream, containing the pdf-file.(<a href="https://i.stack.imgur.com/CMWuV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CMWuV.png" alt="Response Header"></a>) </p>
  
  <p>My angular call looks like this:</p>
  
  <pre><code> $http.post($rootScope.HostPath + '/report',{ param1:value, param2:value }).
                  then(function success(response) {
                      //magic should happen here :(
                  },function error(response) {
                      console.log("Error Code : " + response.status );
                  });
          }
  </code></pre>
  
  <p>How can I get the PDF out of this response javascript variable or is it possible to forward the response directly to the browser.</p>
  
  <p>When I request with Postman or other tools, a download dialog pops up immediately. I've tried a lot of different solutions from stackoverflow but non of them are working in my case.</p>