0

I am pretty new to Angular JS technology. I want to call following protected REST URL.

 http://localhost/rest/bpm/wle/v1/search/query?condition=taskActivityName|Equals|Cashier Review&condition=taskStatus|Equals|Received&organization=byTask&run=true&shared=false&filterByCurrentUser=false

Following code is not working for me. It is taking only `http://localhost/rest/bpm/wle/v1/search/query .Please suggest.

var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
var URLBASE = "http://localhost/rest/bpm/wle/v1";
var userid = "harish.puli";
var password = "Password1";
 // End of buildAuthorization
  var options =$.param ({
    query : {
                organization : "byTask",
                condition : [ "taskActivityName|Equals|Cashier Review", "taskStatus|Equals|Received" ]
            },
            handleAs : "json",
            user: "harish.puli",
            password: "Password1"
        });
  var url=URLBASE+"/search/query";
  $http.post(url,options).success(function (response) {
    console.log(response);
    $scope.tasks = response.data.data;
    });
});
  • Maybe this is what you are looking for: http://stackoverflow.com/questions/30957248/how-to-send-post-in-angularjs-with-multiple-params – Setily Jul 12 '16 at 14:56

2 Answers2

0

I believe you're missing a '?' after query based on the URL you provided.

Try:

var url=URLBASE+"/search/query?";
developthewebz
  • 1,647
  • 2
  • 15
  • 41
0

Your code is only calling http://localhost/rest/bpm/wle/v1/search/query because you're using post instead of get. In get you transmit the parameters in the URL but in post they are transmitted in the body of the request.

benohead
  • 655
  • 3
  • 9