Quite new to angularjs, but already done some research. I'm making the following $http post request:
$scope.onClick2 = function () {
var myRequest = {};
myRequest = {};
myRequest.ServiceType = "SearchExams";
myRequest.SessionId = 'SessionlessRequest';
myRequest.Compression = 'no';
myRequest.Parameters = {};
myRequest.Parameters.Status = ['30', '40'];
myRequest = JSON.stringify(myRequest);
var request = $http({
method: 'POST',
url: 'http://localhost/request.php',
data: 'data=' + myRequest,
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
})
};
My request.php handles the request and sends back an json response. Howerver I see in the response tab of chrome and in fiddler that the original request is also in the response. See below:
Array
(
[data] => {"ServiceType":"SearchExams","SessionId":"SessionlessRequest","Compression":"no","Parameters":{"Status":["30","40"]}}
)
{"Error":false,"ErrorMessage":null,"Data":[{"ExamID":1,"A.......
I would expect only the last line ({"Error":false,"ErrorMessage":null,"Data":[{"ExamID":1,"A...... to be returned....looking at what my request.php send back it should.
Am I missing something?
Thanks,