当前位置:网站首页>MiniAPI of .NET6 (14): Cross-domain CORS (Part 1)
MiniAPI of .NET6 (14): Cross-domain CORS (Part 1)
2022-08-03 22:25:00 【51CTO】
To illustrate cross-requests,创建了两个项目,一个mini api,端口是5001,另一个razor page项目,端口是5280.5280The item will be used on the pageajax的方式来请求5001,Form a cross-domain request,由于是本地测试,host都是localhost,So by port number is different,form different domains.
api项目
页面项目
运行结果:

默认情况下,只允许get,post,head三种方法,It is also possible to allow all method access.
运行结果:

All open cross-domain access,配置简单,但安全性较低,If you need to disable some resources that do not need to be accessed,可以在对应的url上放置DisableCors特性,To control cross-domain access.
运行结果

想要更快更方便的了解相关知识,可以关注微信公众号

边栏推荐
- HCIP第十四天
- Embedded systems: overview
- 藏宝计划TreasureProject(TPC)系统模式开发技术原理
- 如何基于WPF写一款数据库文档管理工具(二)
- Embedded Systems: Clocks
- Diazo Biotin-PEG3-DBCO | Diazo Compound Modified Biotin-Tripolyethylene Glycol-Dibenzocyclooctyne
- JPA Native Query(本地查询)及查询结果转换
- LabVIEW code generation error 61056
- CAS: 1192802-98-4 _uv cracking of biotin - PEG2 - azide
- Makefile
猜你喜欢

encapsulation, package, access modifier, static variable

Network basic learning series four (network layer, data link layer and some other important protocols or technologies)

Embedded Systems: GPIO
![[MySQL Advanced] Creation and Management of Databases and Tables](/img/31/2015122e409148b3679b09a03db869.png)
[MySQL Advanced] Creation and Management of Databases and Tables

win10系统下yolov5-V6.1版本的tensorrt部署细节教程及bug修改

LabVIEW代码生成错误 61056

Cisco ike2 IPSec configuration

深度学习和机器学习有什么区别?

【刷题篇】二叉树的右视图

如何创建一个Web项目
随机推荐
2022-08-03 Oracle executes slow SQL-Q17 comparison
生成器版和查看器版有什么区别?
21天打卡挑战学习MySQL—Day第一周 第一篇
PowerMockup 4.3.4::::Crack
UVa 1025 - A Spy in the Metro (White Book)
Data_web(八)mysql增量同步到mongodb
LabVIEW代码生成错误 61056
483. Smallest Good Base
October 2019 Twice SQL Injection
385. Mini Parser
start with connect by implements recursive query
Boss: There are too many systems in the company, can you realize account interoperability?
Diazo Biotin-PEG3-DBCO | Diazo Compound Modified Biotin-Tripolyethylene Glycol-Dibenzocyclooctyne
嵌入式系统:GPIO
关于Yii2批量更新的操作
Bytebase database schema change management tool
Makefile
Golang第一章:入门
113. Teach a Man how to fish - How to query the documentation and technical implementation details of any SAP UI5 control property by yourself
2022-08-02 mysql/stonedb慢SQL-Q18-内存使用暴涨分析