当前位置:网站首页>webapi接口文件下载时跨域问题
webapi接口文件下载时跨域问题
2022-07-29 07:25:00 【wtnu200】
使用Microsoft.AspNet.WebApi.Core可以解决普通接口的跨域,但如果接口功能是下载文件,像我的Webapi添加了下载pdf接口,不管客户端怎么调用,都会有提示跨域,目前在解决方法是在此接口加上
response.AddHeader("Access-Control-Allow-Origin", "*");
就可以解决问题
边栏推荐
- mysql 单表最多能存多少数据?
- 5-整合swagger2
- [summer daily question] Luogu P6500 [coci2010-2011 3] zbroj
- A long article --- in-depth understanding of synchronized
- Introduction to log4j layout
- BeanUtils.setProperty()
- QT basic day 2 (2) QT basic components: button class, layout class, output class, input class, container and other individual examples
- Getting started with JDBC
- PAT甲级 1154 顶点着色
- QT连接两个qslite数据库报错QSqlQuery::exec: database not open
猜你喜欢
随机推荐
BeanUtils.setProperty()
gin abort不能阻止后续代码的问题
[summer daily question] Luogu p6320 [coci2006-2007 4] sibice
MySQL uses the client and select methods to view the summary of blob type fields
Gin template
程序的静态库与动态库的区别
Does Flink support sqlserver databases? Get the changes of SQLSERVER database
I'd like to ask, my flick job writes data in the way of upsert Kafka, but I'm more careful in MySQL
PAT甲级 1150 旅行商问题
QT基础第二天(2)qt基础部件:按钮类,布局类,输出类,输入类,容器等个别举例
[summer daily question] Luogu P6500 [coci2010-2011 3] zbroj
SEGGER 的硬件异常 分析
Some learning and understanding of vintage analysis
Scala 高阶(十):Scala中的异常处理
jdbc入门
Docker最新超详细教程——Docker创建运行MySQL并挂载
logback 中FileAppender具有什么功能呢?
Segger's hardware anomaly analysis
亚马逊云助手小程序来啦!
How much data can a single MySQL table store at most?