我已經在Amazon EC2實例上部署了我的網站,並在EC2實例上安裝了mysql數據庫。我使用apigee作爲管理工具,並創建了通過PHP連接到我的mysql數據庫的API代理。但是當我試圖通過HTTP POST和GET發送或接收來自數據庫的數據時,它不起作用。我沒有將PHP腳本作爲/localhost/.../abc.php調用,而是使用了通過Apigee創建的代理。 anyboby可以告訴我我在這裏做錯了什麼。 注意:當我使用localhost代替代理時,我的代碼工作正常。 這裏是使用本地主機,使用Apigee代理我的HTTP請求,HTTP POST/GET請求不能與Apigee代理和AWS
將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;
});
這是虛擬代理..我檢查了在瀏覽器中點擊這個URL,它正在工作。 – pankaj 2015-02-09 06:05:06