title: Injecting $http service into $http interceptor?
body: <p>I have the following interceptor:</p>
  
  <pre><code>var interceptor = ['$http', '$q', function ($http, $q) {
       //...
  }];
  </code></pre>
  
  <p>This generates a <strong>circular dependency</strong>, because <code>$http</code> will depend on this interceptor, and this interceptor will depend on <code>$http</code>.</p>
  
  <p>I want to get the <code>$http</code> service because I intend to refresh some authorization tokens of the user if I get a <strong>401 Unauthorized</strong> response.</p>
  
  <p>For this, I have to call my OAuth endpoint and retrieve the new tokens.</p>
  
  <p>How can I inject this service into my interceptor?</p>
  
  <p>I also tried the following alternative:</p>
  
  <pre><code>var interceptor = ['$injector', '$q', function ($injector, $q) {
       var $http = $injector.get('$http');
  }]
  </code></pre>
  
  <p>But I'm getting the same error.</p>
  
  <p>Is this possible?</p>
  
  <p>I don't want to use the <code>jQuery</code> library and I want my application to be pure AngularJS, so <code>$.ajax(...)</code> answers are not useful to me.</p>