title: Redo previous request when the first fails with 401 Unauthorized
body: <p>I'm building an Android application that will fetch data from a REST API.</p>
  
  <p>To make the requests I'm using <a href="http://square.github.io/retrofit/" rel="noreferrer">Retrofit</a> together with <a href="http://square.github.io/otto/" rel="noreferrer">Otto</a>.</p>
  
  <p>For all my requests I add a RequestInterceptor that will add a header (Authorization) to all my requests.
  In the RequestInterceptor I'm calling a method to the my current access_token then I populate the header to the request.</p>
  
  <pre><code>RequestInterceptor requestInterceptor = new RequestInterceptor() {
  
      @Override
      public void intercept(RequestFacade request) {
          Token token = TokenPreferences.getToken();
  
          request.addHeader("Authorization", token.getTokenType() + " " + token.getAccessToken());
      }
  };
  
  RestAdapter restAdapter = new RestAdapter.Builder()
        .setEndpoint("https://example.com")
        .setRequestInterceptor(requestInterceptor)
        .build();
  
    ...
  </code></pre>
  
  <p>This works fine until the access_token has expired, then the request will fail with HTTP status 401 Unauthorized.
  When this happens, I want to make a new request to get a new access_token from my refresh_token I got and then do the first request again.</p>
  
  <p>I'm not really sure how to make that work.</p>