我正在使用ajax向我的api发出GET请求。api返回一个图像和一些其他信息(我想发送的信息)。我使用fastapi的FileResponse函数发送图像。我没有得到的是如何在wbepage上显示从api发送的图像。我正在寻找用于显示通过FileResponse发送的图像的javascript。 api中的返回语句:
return {'img_src':FileResponse(Path_to_the_image), 'Tables':output_dic}
html端代码:
$.ajax({
url: URL for api,
type: 'get',
dataType : "json",
contentType: "application/json; charset=utf-8",
success: function(response){
I am using the contents of response here
}
我能够成功地使用与图像一起返回的“表”的内容,但我不知道如何显示发送的图像。谁能告诉我怎么做。 先谢谢你
目前没有回答
相关问题 更多 >
编程相关推荐