[Vuejs]-Vue JS axios HTTP500 Internal Server

0👍

Finally cracked it, it was CORS all along!

services.AddCors(options =>
        {
            options.AddPolicy("AllowAllHeaders",
                  corsbuilder =>
                  {
                      corsbuilder.AllowAnyOrigin()
                                 .AllowAnyHeader()
                                 .AllowAnyMethod()
                                 .WithOrigins("http://localhost:8080");   
                  });
        });

The WithOrigins helped

And enabled cors with a policy on the controller
[EnableCors(“AllowAllHeaders”)]

Leave a comment