API 响应必须显示图像

问题描述 投票:0回答:1

每次我点击或搜索网址时,它都会显示随机代码 enter image description here

如果我对网址示例使用 get 方法,我试图在邮递员或浏览器中实现图像的结果: https://localhost:7131/owner/trainee/photo/TEST/TEST.jpg 它应该直接显示图像

这是我的API代码 [HttpGet("照片/{令牌}/{文件名}")] 公共异步任务 traineePicture() {=Byte[] b = System.IO.File.ReadAllBytes(@"C:\Users\lem\Pictures\Saved Pictures ando-jpeg-quality-001.jpg"); 返回文件(b,“图像/jpg”); }

asp.net postman
1个回答
0
投票

你能展示 API 路由器的代码吗

© www.soinside.com 2019 - 2024. All rights reserved.