I am working with WebApi using .net core 2.2. If I access the API with URL https://localhost:44352/api/values, it works fine. But if I changed to use http://localhost:44352/api/values, using HTTP instead of HTTPS, it could not load.
This is Configure in Startup.cs
public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } //app.UseSwagger(); //app.UseSwaggerUI(x => //{ // x.SwaggerEndpoint(@"/swagger/v1/swagger.json", "My Api v1"); // x.RoutePrefix = "api"; //}); app.UseHttpsRedirection(); app.UseMvc(); } Can anyone explain to me what is wrong?