CORS ISSUES .NETCORE API

Use the following code in the ConfigureService method of the StartUp file on your projects.
 Then add the code app.UseCors("CORSPOLICY"); on the Configure method  in the same file.



 services.AddCors(options =>
            {
                options.AddPolicy("CORSPOLICY",
                    builder =>
                    {
                        builder
                        .AllowAnyMethod()
                        .AllowAnyHeader()
                        .AllowAnyOrigin();
                    });
  });


Tal vez te interesen estas publicaciones

Deja tu comentario

0 Comentarios