The $http module provides only the asynchronous version of XMLHttpRequest , so the signature you are looking for is not possible. If you do not want to fall back to another structure (for example, jQuery), you will have to use the returned Promise object.
Think of it as a factory object with which you register handlers that will be called when data returns. They can be chained, so if you want to process the data before passing it downstream, you can just do it in the handler that you register using the then method . Any result that you return in the handler will become data for the next then handler.
(Note that unlike success() , the argument to your handler is the type IHttpPromiseCallbackArg , not the data itself.)
source share