Http post with external request object.
var req = {
method: 'POST',
url: ENV.API_END_POINT + '/users',
headers: {
'Authorization': 'Basic ' + Base64Service.encode(mUser + ':' + mPass)
},
data: user
};
$http(req)
.success(function(data) {
deferred.resolve(data);
})
.error(function(data) {
deferred.reject(data);
});