码迷,mamicode.com
首页 > Web开发 > 详细

asp.net Core 跨域配置

时间:2018-11-21 18:34:35      阅读:241      评论:0      收藏:0      [点我收藏+]

标签:跨域   build   har   csharp   service   class   header   sha   with   

1.添加中间件

在ConfigureServices中添加

 //跨域中间件服务
            services.AddCors();

 

在 Configure中添加

 

 //跨域配置
            app.UseCors(builder => builder.WithOrigins("http://example.com").AllowAnyHeader());

  

asp.net Core 跨域配置

标签:跨域   build   har   csharp   service   class   header   sha   with   

原文地址:https://www.cnblogs.com/xuqp/p/9996687.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!