title: Save response as file
body: <p>I have WebAPI method which returns <code>HttpResponseMessage</code> with <code>.csv</code> file as Content:</p>
  
  <pre><code>private static HttpResponseMessage FileAsAttachment(string file)
  {
      var now = DateTime.Now;
      var result = new HttpResponseMessage(HttpStatusCode.OK);
  
      result.Content = new StringContent(file);
      result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
      result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment"); //attachment will force download
      result.Content.Headers.ContentDisposition.FileName = string.Format("Report-{0}.csv", now.ToString("MMMM"));
  
      return result;
  }
  </code></pre>
  
  <p>So I have just click function, which make call to server :</p>
  
  <pre><code>$scope.GenerateReport = function() {
       var endDate = '2016-04-30';
       UserDaysSummary.generateReport({endDate: endDate }, function (result) {
            console.log("Export");
       });
  }
  </code></pre>
  
  <p>But all that I've got - is a response with data inside. 
  I've tried to get it as file using <a href="https://stackoverflow.com/a/27442914/3917754">this</a> and <a href="https://stackoverflow.com/a/22448640/3917754">this</a> answer, but this doesn't change anything.</p>
  
  <p>Preferably, that call to the server has <code>GET</code> method, btw</p>