title: Reusing HttpClient for different users
body: <p>I've been reading a lot about best practices when using <code>HttpClient</code>. Most people recommend reusing it for the lifetime of the application, even though it's <code>IDisposable</code>.</p>
  
  <p>My web application is communicating with various APIs, like Facebook Graph API, Twitter API and Instagram API.</p>
  
  <p>The plan is to create an individual HttpClient for each API it communicates to, which is recommended, because then I can reuse some of the headers.</p>
  
  <p>But now to the question, let's take the Twitter API as an example, each user using my web application has its own authorization header (user bound access token). I believe this means that I can't set the authorization header to the DefaultRequestHeaders of the <code>HttpClient</code> object.</p>
  
  <p>What is the best practice when it comes to reusing <code>HttpClient</code> for multiple users who have different authorization headers?</p>
  
  <p>Could I create a <code>HttpRequestMessage</code> object for each request and set the authorization header on the httpRequestMessage object, instead of setting it to the default one, <code>httpClient.DefaultRequestHeaders.Authorization</code>?</p>
  
  <p>Thanks.</p>