Skip to content

Preview View

The Preview view renders the response body based on its content type.

If the response content type is text/html, the preview view renders the HTML in a sandboxed iframe:

<!-- Response body (HTML) -->
<html>
<body>
<h1>Hello from the API</h1>
<p>This HTML is rendered in the preview panel.</p>
</body>
</html>

If the response content type is an image (image/png, image/jpeg, image/gif, image/svg+xml), the preview displays the image inline.

For all other content types, the preview falls back to displaying the raw text.

The HTML preview iframe uses the allow-scripts sandbox attribute, which:

  • Blocks pop-ups
  • Blocks form submissions
  • Blocks same-origin access
  • Allows JavaScript execution (any JS in the HTML will run inside the sandbox)