我使用Angular2,有休息API溝通,設置像這樣的標題:的預檢Angular2響應無效(重定向)從一些GET請求
import { Headers } from '@angular/http';
export const contentHeaders = new Headers();
contentHeaders.append('Accept', 'application/json');
contentHeaders.append('Content-Type', 'application/json');
contentHeaders.append('Authorization', localStorage.getItem('id_token'));
Get請求像items/
和POST請求的作品,但當對一個項目進行GET請求時,如:items/579212a6541d5626732619c3
服務器響應服務器錯誤Response for preflight is invalid (redirect)
我認爲那些獲取請求是相同的,但也許它們不是?任何解決方案
聲音就像服務器沒有提供CORS請求的正確響應。 –