title: Can't read from server. It may not have the appropriate access-control-origin settings
body: <p>I am getting the following error: <strong>Can't read from server. It may not have the appropriate access-control-origin settings.</strong> when the code is deployed to the server.
  I did a lot of research adding the
  Added following code in web.config </p>
  
  <pre><code>    &lt;httpProtocol&gt;
        &lt;customHeaders&gt;
          &lt;add name="Access-Control-Allow-Origin" value="*" /&gt;
          &lt;add name="Access-Control-Allow-Methods" value="GET, POST, OPTIONS, PUT, DELETE" /&gt;
        &lt;/customHeaders&gt;
      &lt;/httpProtocol&gt;
  </code></pre>
  
  <p>or in the startup project</p>
  
  <pre><code>public static void Configuration(IAppBuilder app)
          {
              app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
          }
  </code></pre>
  
  <p>or int the webapi.config -> Register</p>
  
  <pre><code>config.EnableCors(new EnableCorsAttribute("*", "*", "*"));
  </code></pre>
  
  <p>Can some help? did anyone had the same issue</p>
  
  <p><a href="https://i.stack.imgur.com/x7tSP.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/x7tSP.jpg" alt="enter image description here"></a></p>