title: Implement wrapper/global AJAX request handler?
body: <p>In Angular.js Is it possible to implement a wrapper that will execute whenever a AJAX post request is made and gets a 401 HTTP response?</p>
  
  <p>My web app makes dozens of RESTful requests to the server. If their login session expires the server returns a HTTP 401 response. Now, that doesn't trigger the 'fail' function of the post request (annoyingly). But even if it did, I don't want to now edit dozens of RESTful requests functions and have them check if the error response == 401 then refresh the page (to force the user to re-login).</p>
  
  <p>I just want to implement a POST wrapper that will affect all current and future requests. Is this possible?</p>