1

I have seen similar question to mine here but I am not using curl. I want to get the list of all surveys and here is my code for service:

 return $http.post(url, {}, {
            transformRequest: function(data, headersGetter) {
                var headers = headersGetter();
                headers['Authorization'] = authorization;
                return headers;
            },
            dataType: "json",
            data: JSON.stringify({}),
            headers: {
                "Content-Type": "application/json"
            }

        }).then(function (response) {
            return response.data;
        });

and here is the way I call it

 $scope.getSurveyList = function () {
        surveyResource.getSurveyList()
            .then(function (surveys) {
                if (surveys) {
                }
            });
    }

for some reason the "Request Payload" is always [object object]! I tried different suggestions but still getting the same error

errmsg: "Expected object or value"
status: 3
Community
  • 1
  • 1
Sara
  • 2,308
  • 11
  • 50
  • 76

0 Answers0