title: Why use HttpClient over HttpWebRequest for synchronous requests
body: <p>In my scenario, I have to send data from one web application to a webapi which is an effective data store. The requests are necessarily synchronous and I most definitely want an <code>Exception</code> thrown if something goes awry as it means a critical part of the application is unavailable.</p>
  
  <p>This is a derivative of, though not duplication of an existing question; <a href="https://stackoverflow.com/questions/14435520/why-use-httpclient-for-synchronous-connection">Why use HttpClient for Synchronous Connection</a>.</p>
  
  <p>Yet over and over, including in the article I see above, I see a consistent recommendation to use <code>HttpClient</code>, even in a synchronous scenario. The best reason I've seen is the accepted answer in the SO post above but it essentially boils down to;</p>
  
  <blockquote>
    <p>Use this because "shiny".</p>
  </blockquote>
  
  <p>Which I'm not liking as an acceptable answer for my scenario. I'd prefer to use the correct object for the task at hand and this seems to be the older <code>HttpWebRequest</code>. Even Ben Watson's excellent resource "Writing High-Performance .NET Code" states the following;</p>
  
  <blockquote>
    <p>Another example is the <code>System.Net.HttpWebRequest</code> class, which will
    throw an exception if it receives a non-200 response from a server.
    This bizarre behavior is thankfully corrected in the
    <code>System.Net.Http.HttpClient</code> class in .NET 4.5</p>
  </blockquote>
  
  <p>But in my scenario, I actually <em>do</em> want that behavior. While there are a lot of good use cases for <code>HttpClient</code>, can anyone offer a good reason not to use <code>HttpWebRequest</code> in my scenario? Am I using the correct object or not? And more importantly, <em>why</em>?</p>