-3
我有一个asp.net核心API的项目,我想读的是存在于我的网站的图像,但我收到404找不到错误的图像。无法读取asp.net网站核心
低于代码行抛出异常时执行GetStreamAsync方法:
foreach (var item in imgUrls)
{
// read from remote image drive
using (HttpClient c = new HttpClient())
{
using (Stream s = await c.GetStreamAsync(item))
{
// do something with the stream...
}
}
}
图片网址是正确的,但是当我尝试应用程序运行时将其粘贴在另一个选项卡中,我没有看到图片显示在我的浏览器中。我错过了一个asp.net配置,或者是通过api响应禁止显示内容文件(如图像)的东西。
注:我们送imageUrls是FQDN的URL,例如URL看起来像:
http://localhost:25071/images/test.jpg
期待您的帮助。
你可以粘贴API代码也? –
你不发表您的中间件配置,如果没有它,我们注定要猜 – Tseng