我有一個$ http.get()的AngularJS調用。在瀏覽器中可以正常使用CORS。 我有一個$ http.post()的AngularJS調用。只有當我將Content-Type頭設置爲「application/x-www-form-urlencoded」時纔有效。在瀏覽器中可以正常使用CORS。
我有一個$ http.put()的AngularJS調用。我試圖將Content-Type標題設置爲「/」通配符,但它不適用於Firefox 36+和Chrome 36+。它給了我一個CORS Blocked。它在IEx11中工作正常
是否有$ http.put()的特定標頭,或者這是FF/Chrome的問題?
$阿賈克斯({ 類型: '把', 網址:remoteURL, 數據類型:「 json「, contentType:」application/x-www-form-urlencoded「, processData:false, data:json, success:function(msg){ alert('Success'); }, error:function(data,errorThrown){ alert('Error'); } }); – user1410990 2015-03-02 20:26:38
在IE中,但不是在FF /鉻 – user1410990 2015-03-02 20:28:29
$ http.put( remoteURL, 數據 ) .success(功能(數據,狀態,響應){ 警報( 'OK'); }) 。錯誤(函數(數據,狀態,配置){alert('Error'); }); – user1410990 2015-03-02 20:28:54