我有一个可以给我html response
的http api,我想对其进行“预览”。
但是其中有一些javascript代码,如果不执行它们,将无法显示正确的页面。
我目前手动将它们复制并粘贴到一些aaa.html文件中,并使用chrome打开它(file://aaa.html),但我想简化这些步骤。
反正邮递员有这样做吗?还是有邮递员替代品可以做到这一点?
邮递员本身可以这样做。您将必须使用pm.visualizer。只需打开您的api请求即可,它会给您html响应。然后转到“测试”标签并添加以下几行。然后单击“可视化”标签。
pm.test(“ set html”,function(){
var template=pm.response.text(); // save your html response in the template and then
// set that template to pm.visualizer.
pm.visualizer.set(template);
})