Generates an XHR request. The $xhr service adds error handling then delegates all requests to
$browser.xhr().
Dependencies
$browser
$xhr.error
$log
Usage
$xhr(method, url[, post], callback);
Parameters
method – {string} –
HTTP method to use. Valid values are: GET, POST, PUT, DELETE, and
JSON. JSON is a special case which causes a
JSONP cross domain request using script tag
insertion.
url – {string} –
Relative or absolute URL specifying the destination of the request. For
JSON requests, url should include JSON_CALLBACK string to be replaced with a name of an
angular generated callback function.
post(optional) – {(string|Object)} –
Request content as either a string or an object to be stringified
as JSON before sent to the server.
callback – {function(number, (string|Object))} –
A function to be called when the response is
received. The callback will be called with: