Skip to content

Instantly share code, notes, and snippets.

@longjasonm
Created November 13, 2019 21:28
Show Gist options
  • Save longjasonm/0faea8b65734187b64bcfa45c822b371 to your computer and use it in GitHub Desktop.
Save longjasonm/0faea8b65734187b64bcfa45c822b371 to your computer and use it in GitHub Desktop.
Add the raw JSON to the end of your Postman Visualizer template.
let template = `
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js?autoload=true&amp;skin=sunburst&amp;lang=js" defer></script>
<!-- Your content goes here -->
<hr>
<h1>Raw JSON Response</h1>
<pre class="prettyprint">{{raw}}</pre>
</div>
`
pm.visualizer.set(template, {
response: pm.response.json(),
raw: JSON.stringify(pm.response.json(), null, '\t')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment