WebApi中启用CORS跨域访问 1.安装 Nugget包Microsoft.AspNet.WebApi.Cors This package contains the components to enable Cross-Origin Resource Sharing (CORS) in ASP.NET Web API. 此包包含启用跨域资源共享的组件(CORS)在ASP.NET Web API. 目前版本是5.2.3 依赖项: Microsoft.AspNet.WebApi.Core (>=
引用nuget包:Microsoft.AspNetCore.Server.Kestrel.Https这是一个服务器测试ssl密钥,密码如代码里面所示 using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hostin