0

I am hosting MVC WebApi to godaddy server and client aplication also hosting to server and i am getting issue with

XMLHttpRequest cannot load my application The 'Access-Control-Allow-Origin' header contains multiple values 'http://xxxxxx.in, *', but only one is allowed. Origin 'http://xxxxx.in' is therefore not allowed access.

2 Answers2

0

I think the answers to this question may provide you with what you need.

asp.net web api 2 CORS and authentication authorization configuration

Community
  • 1
  • 1
sheppe
  • 708
  • 5
  • 12
0

You need to Enable cors in Webapi.config file

Webapi.config

public static class WebApiConfig
{
    public static void Register(HttpConfiguration config)
    {
        var cors = new EnableCorsAttribute("*", "*", "*");
        config.EnableCors(cors);
        // ...
    }
}
  1. First * (aistrik) - For Allow All Origins
  2. Second * (aistrik)- For Allow All headers
  3. Third *(aistrik) - For Allow All methods

I think this would help you.