当前位置:网站首页>webapi接口文件下载时跨域问题
webapi接口文件下载时跨域问题
2022-07-29 07:25:00 【wtnu200】
使用Microsoft.AspNet.WebApi.Core可以解决普通接口的跨域,但如果接口功能是下载文件,像我的Webapi添加了下载pdf接口,不管客户端怎么调用,都会有提示跨域,目前在解决方法是在此接口加上
response.AddHeader("Access-Control-Allow-Origin", "*");
就可以解决问题
边栏推荐
猜你喜欢

Can the subset of the array accumulate K

1 - background project construction

电子元器件贸易企业如何借助ERP系统,解决仓库管理难题?

STM32 operation w25q256 w25q16 SPI flash
![[OpenGL] use of shaders](/img/73/1322afec8add6462ca4b82cb8112d1.png)
[OpenGL] use of shaders

零数科技深度参与信通院隐私计算金融场景标准制定

QT basic day 2 (2) QT basic components: button class, layout class, output class, input class, container and other individual examples

gcc/g++的使用

新生代公链再攻「不可能三角」

09 bloom filter
随机推荐
3-global exception handling
Docker最新超详细教程——Docker创建运行MySQL并挂载
JS day 4 process control (if statement and switch statement)
Female graduate students do "mind mapping" and quarrel with their boyfriend! Netizen: the "king of infighting" in the quarrel
国内数字藏品的乱象与未来
树莓派的启动流程
Gin service exit
How to establish EDI connection with Scania in Scania?
Docker's latest super detailed tutorial - docker creates, runs, and mounts MySQL
Gin Middleware
Use of gcc/g++
js第四天流程控制(if语句和switch语句)
Reflect reflect
Practice of online problem feedback module (XVII): realize the online download function of excel template
受欢迎的牛 G
Summer summary (II)
Does Flink support sqlserver databases? Get the changes of SQLSERVER database
Other basic monitoring items of ZABBIX
logback简介及引入方法
【暑期每日一题】洛谷 P6408 [COCI2008-2009#3] PET