I have the following angular service:
angular.module('app.services.api_login', []) .factory('loginApi', function($http, $q, CONFIG) { return function(email, password) { var promise = $http({ method: 'POST', url: CONFIG.login_url, data: { username: email, password: password }, headers: {'Content-Type': 'application/json'} }). then(function(response){ if (typeof response.data === 'object') { return response; } else { return $q.reject(response); } }, function(error){ return $q.reject(error); }); return promise; } }); In the controller, I am able to invoke the service. However, inspecting the Network requests made by the browser, it does an HTTP GET.
Any possible ideas why?