I have deployed my web site on Amazon EC2 instance and having mysql database installed on EC2 instance. I have used apigee as management tool and created the proxy for API which connect to my mysql DB through PHP. But when i am trying to send or receive data from DB through HTTP POST and GET, It is not working. Instead of calling PHP script as /localhost/.../abc.php I have used proxy that created through Apigee. Can anyboby tell me what i am doing wrong here. Note : When i am using localhost instead of proxy my code is working fine. here is my HTTP requests using localhost and using Apigee proxy,
Using localhost :
$http.get('http://localhost/MWS/abc.com/api.php?action=get_productdetails').
success(function(data) {
$scope.products = data.returnop;
});
$http.post('http://localhost/MWS/abc.com/api.php?action=get_orderdetails',
{ 'userid' : UserID
}).
success(function(data) {
$scope.orderdet = data.orderdetails;
});
Using Apigee proxy :
$http.get('http://pmn1-test.apigee.net/apicall?action=get_productdetails').
success(function(data) {
$scope.products = data.returnop;
});
$http.post('http://pmn1-test.apigee.net/apicall?action=get_orderdetails',
{ 'userid' : UserID
}).
success(function(data) {
$scope.orderdet = data.orderdetails;
});
Please learn to print some error messages, meaningful error messages, when 'something' fails. Hopefully the writer of 'something' that is failing would have provided enough information in the error message for you to be able to figure out what is wrong. At least that is a starting point. You do not even have a HTTP layer error message (like timeout) OR HTTP return, like 500, printed.