我已经在AmazonEC2实例上部署了我的网站,并在EC2实例中安装了mysql数据库。我使用apigee作为管理工具,并为API创建了代理,该代理通过PHP连接到我的mysqlDB。但当我试图通过HTTP POST和GET从DB发送或接收数据时,它不起作用。而不是将PHP脚本调用为localhost//abc.php我使用了通过Apigee创建的代理。有人能告诉我我在这里做错了什么吗。
注意:当我使用localhost而不是代理时,我的代码工作正常。
这是我使用localhost和Apigee代理的HTTP请求,
使用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;
});
使用Apigee代理:
$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;
});