2013-05-21 45 views
0

我有我已經啓用了CORSCORS用的WebAPI asp.net和使用OData的微風

HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "http://localhost:63736"); 
     HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "POST,GET,DELETE,PATCH,PUT,OPTIONS"); 
     HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, Accept,WWW-Authenticate"); 

調用一個項目,.../API /登錄使用jQuery怎麼過,當我試圖通過確定用微風查詢odata我得到cors錯誤

XMLHttpRequest cannot load http://localhost:53809/odata/Metadata. Origin http://localhost:63736 is not allowed by Access-Control-Allow-Origin. 

怎麼回事?

回答