title: ASP .NET Core asynchronous partial view
body: <p>From an ASP .NET Core web app I am trying to make a call to a Drupal web api using React.js, however I get the following error:</p>
  
  <blockquote>
    <p>No 'Access-Control-Allow-Origin' header is present on the requested
    resource. Origin '[my-drupal-api]' is therefore not allowed access.</p>
  </blockquote>
  
  <p>I have tried adding the following to my Startup.cs:</p>
  
  <pre><code>services.AddCors(options =&gt;
  {
     options.AddPolicy("CorsPolicy",
     builder =&gt; builder.AllowAnyOrigin()
     .AllowAnyMethod()
     .AllowAnyHeader()
     .AllowCredentials());
  });
  
  app.UseCors("CorsPolicy");
  </code></pre>
  
  <p>and I still get the same error.</p>
  
  <p>I am curious if there is another way to do this server-side, without react. Is there way a way to do an asynchronous partial view that will load the data returned from the Drupal web api, without delaying the load of the rest of the page?</p>
  
  <p>Thanks!</p>