![](/img/trans.png)
[英]How can i convert type IPython.core.display.Image to base64 string using tempfile?
[英]How can I visualize a base64 image in Postman?
您可以使用Postman 的可視化功能。 我創建了一個公共示例來演示這一點。 為此,我在請求正文上設置了一個示例 base64 圖像,並使用Postman Echo ,它只是在數據字段上返回相同的值。 有了這個,我只是讀取數據並使用可視化工具來呈現它:
// Image is found on the respose on the data field
const imageBase64 = pm.response.json().data;
// This is just a simple template with a placeholder for a base64 image
var template = `<img src="data:image/svg+xml;base64,{{image}}" />`
// Set visualizer - Inits handle bars and passes the image variable to the template
pm.visualizer.set(template, {
// Pass the response body parsed as JSON as `data`
image: imageBase64
});
如果單擊“ Visualize
”選項卡,這將如下所示:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.