title: HttpResponseMessage Content won't display PDF
body: <p>I have created a Web Api that returns an HttpResponseMessage in which the content is set to a PDF file. If I call the Web Api directly it works great and the PDF is rendered in the browser.</p>
  
  <pre><code>response.Content = new StreamContent(new FileStream(pdfLocation, FileMode.Open, FileAccess.Read));
          response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/pdf");
          response.Headers.ConnectionClose = true;
          return response;
  </code></pre>
  
  <p>I have an MVC Client that would like to do contact the Web Api, request the Pdf file then render it to the user in the same way as above.</p>
  
  <p>Unfortunately, I'm not sure where the problem is but even though I set the the content-type:</p>
  
  <pre><code>response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/pdf");
  </code></pre>
  
  <p>When I click on the link that calls the web api, I get a text rendering of the HttpResponseMessage.</p>
  
  <pre><code>StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: { Connection: close Content-Disposition: attachment Content-Type: application/pdf }
  </code></pre>
  
  <p>I'm thinking that the Client Application is missing some setting that will allow it to render the PDF like my Web Api does...</p>
  
  <p>Any help would be appreciated.
  Thanks</p>