Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them, it only takes a minute:

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;
    });
});
share|improve this question

2 Answers 2

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

Try:

var url=URLBASE+"/search/query?";
share|improve this answer
    
I tried..still is the same...not working – Harish Puli Sep 11 at 19:18

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.

share|improve this answer
    
Can you tell me how to pass these parameters in post? – Harish Puli Sep 11 at 19:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.