$http.post(url, { parm1: { name: 'rick', location: 'home', website: 'west-wind.com' }, parm2: id, parm3: key });JSON services generally can't receive 'multiple' parameters and can't receive complex objects via GET so you probably need to use POST to send the data. POST operations require that you pass a single object so that single object should be a wrapper around the 'parameters' you send. The server can then deconstruct that object and pull out the parameters.
>>function callService(parm1,parm2) { >> return $http.get('service/endpoint',{p1: parm1, p2: parm2}) >> .success(function() { console.log('initial success"); }) >> .error(function() { showError('failed"); }); >>} >>>>
>>callService(parm1,parm2) >> .success(function() { alert('made it!' }); >>>>
>>>var getAccounts = function(queryRequest) { >>> var deferred = $q.defer(); >>> $http.get('/api/accounts', { params: queryRequest }) >>> .success(function(data) { >>> deferred.resolve(data); >>> }) >>> .error(function(data, status, header, config) { >>> deferred.reject(status); >>> }); >>> return deferred.promise; >>> }; >>> >>> var getAccountInvoices = function (acctNameHash, showFinalized) { >>> var deferred = $q.defer(); >>> $http.get('/api/accounts/getAccountInvoices/' + acctNameHash + '/' + showFinalized) >>> .success(function (data) { >>> deferred.resolve(data); >>> }) >>> .error(function (data, status, header, config) { >>> deferred.reject(status); >>> }); >>> return deferred.promise; >>> };>>>
>>>{ params: queryRequest, acctNameHash, showFinalized }>>>