Check out example codes for "enable cors asp.net mvc". It will help you in understanding the concepts better.

Code Example 1

Response.AppendHeader("Access-Control-Allow-Origin", "*");

Code Example 2

public static void Register(HttpConfiguration config)
{
    var corsAttr = new EnableCorsAttribute("http://example.com", "*", "*");
    config.EnableCors(corsAttr);
}

Code Example 3

public static void Register(HttpConfiguration config)
{
    // New code
    config.EnableCors();
}

Learn ReactJs, React Native from akashmittal.com