function $xhrFactoryProvider() {
  this.$get = function() {
    return function createXhr() {
      return new window.XMLHttpRequest();
    };
  };
}
@ngdoc service
@name $xhrFactory
@this

@description
Factory function used to create XMLHttpRequest objects.

Replace or decorate this service to create your own custom XMLHttpRequest objects.

```
angular.module('myApp', [])
.factory('$xhrFactory', function() {
  return function createXhr(method, url) {
    return new window.XMLHttpRequest({mozSystem: true});
  };
});
```

@param {string} method HTTP method of the request (GET, POST, PUT, ..)
@param {string} url URL of the request.