title: http connection between ReactSample and AsP.NET Core WebApi
body: <p>I am using axios for http request.
  in frontend</p>
  
  <pre><code>async componentDidMount() {
  const { data: posts } =await axios.get("http://localhost:58944/api/posts");
  this.setState({ posts });
  }
  </code></pre>
  
  <p>and in backend .request from frontend is received.and in console browser look like below.
  <a href="https://i.stack.imgur.com/fnpUg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fnpUg.png" alt="enter image description here"></a></p>
  
  <p>setting in backend from cors is done:</p>
  
  <pre><code>services.AddCors(options =&gt;
          {
              options.AddPolicy("ReactCorsPolicy", builder =&gt; builder.AllowAnyMethod()
                                                                     .AllowAnyHeader()
                                                                     .WithOrigins("http://localhost:3000/")
                                                                     .AllowCredentials()
                                                                     .Build());
          });
  </code></pre>
  
  <p>in ConfigureServices and in Configure function </p>
  
  <pre><code>  app.UseRouting();
  
          app.UseCors("ReactCorsPolicy");
  
          app.UseAuthorization();
  
          app.UseEndpoints(endpoints =&gt;
          {
              endpoints.MapControllers();
          });
  </code></pre>
  
  <p>and error in this picture.</p>