CORS using asp.net web api 2 odata and breeze

后端 未结 1 490
离开以前
离开以前 2021-01-22 14:37

I have problem consuming my OData with Breeze. My api is hosted on another server, and I\'m using asp.net web api 2.0 (which comes with VS 2013 preview). I know web api is prope

相关标签:
1条回答
  • 2021-01-22 14:56
    var cors = new EnableCorsAttribute(
        "http://localhost:7122/",
        "*",
        "*",
        "DataServiceVersion, MaxDataServiceVersion"
    );
    config.EnableCors(cors);
    

    Try adding DataServiceVersion and MaxDataServiceVersion to your EnableCorsAttribute. This worked for me. I found it here.

    0 讨论(0)
提交回复
热议问题