title: How to set contentType in angularjs $http.get
body: <p>I have following code in angular for calling a Web API that returns an array of bytes. 
  I would like to set the ContentType to 'application/pdf', which is very simple to do in a jQuery ajax call, but cannot find a way to do this in angularjs.</p>
  
  <p><strong>Question</strong>: How would I do this for code below in angularjs?</p>
  
  <pre><code>  return $http.get('/api/v1/alarms/exportsummarytopdf?start=2011-03-
       30T05:00:00.000Z&amp;end=2015-04-14T05:00:00.000Z')
      .then(getSummaryPdfExportComplete)
             .catch(function (message) {
                 exception.catcher('XHR failed for getSummaryPdfExport')(message);
             });
  
          function getSummaryPdfExportComplete(response) {
              logger.info('getSummaryPdfExport: complete');
              return response.data;
          }
  </code></pre>
  
  <p><strong>UPDATE 1</strong>:</p>
  
  <p>When I go to a similar URL duirectly, then Chrome clearly shows content-type as 'application/pdf'. May be I need to use something else when calling a web api that returns an array of bytes.</p>
  
  <p><img src="https://i.stack.imgur.com/yjxcY.png" alt="enter image description here"></p>
  
  <p>The error displayed in Chrome is as below.
  <img src="https://i.stack.imgur.com/b3DqV.png" alt="enter image description here"></p>
  
  <p>The headers for this failed request, when I use responseType: 'arraybuffer' is as below.
  <img src="https://i.stack.imgur.com/75jXV.png" alt="enter image description here"></p>