title: Automatically retry on 401 and send specific request with HttpClient 4.3
body: <p>I use specific auth mechanism in the app.
  To login app sends login request to specific url /login/ and gets back session token that is stored in cookie. </p>
  
  <p>At any time token can be invalidated by server and other requests will result in 401. I want HttpClient to detect 401 error automatically, redo /login/ request once and retry original request automatically.</p>
  
  <p>I've tried setting HttpRequestRetryHandler in HttpClients.custom().setRetryHandler but it seems it does not handle 401 errors.</p>
  
  <p>What would be the best way of doing requested functionality?</p>