3
我嘗試使用$ HTTP(角),此代碼發送HTTP請求:離子,訪問控制允許來源
$http({
method: 'GET',
url: 'http://192.168.0.17:9000',
header: {'Access-Control-Allow-Origin': "*"},
}).then(getEventsSuccess, getEventsError);
但是,這並不工作,我在Web控制檯此錯誤:
XMLHttpRequest cannot load http://192.168.0.17:9000/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access.
您有解決方案嗎?
訪問控制允許來源必須設置服務器端,而不是客戶端 – Jamby
聽起來像CORS問題 – swapnesh
我做它在兩側,但同樣的問題。 .. –