<hr>

<div class="row">
  <div class="col-md-12">
    <h2><%= @request_type %> <small><%= @url %></small></h2>

    <h4>Request Headers</h4>
    <ul>
      <% @request_data['headers'].each do |header_name, header_value| %>
        <li>
          <strong><%= header_name %>: </strong><%= header_value %>
        </li>
      <% end %>
    </ul>

    <hr>

    <h4>Response Headers</h4>
    <ul>
      <% @response_data['headers'].each do |header_name, header_value| %>
        <li>
          <strong><%= format_http_header header_name %>: </strong><%= header_value %>
        </li>
      <% end %>
    </ul>

    <% unless @request_type == 'HEAD' %>
    <h4>Body</h4>
    <div class="row">
      <div class="col-md-12">
        <pre class="prettyprint"><%= h @response_data['body'] %></pre>
      </div>
    </div>
    <% end %>
  </div>
</div>

<hr>

<div class="row">
  <div class="col-md-12">
    <h2><%= @request_type %> <small><%= @url %></small></h2>

    <h4>Request Headers</h4>
    <ul>
      <% @request_data['headers'].each do |header_name, header_value| %>
        <li>
          <strong><%= header_name %>: </strong><%= header_value %>
        </li>
      <% end %>
    </ul>

    <hr>

    <h4>Response Headers</h4>
    <ul>
      <% @response_data['headers'].each do |header_name, header_value| %>
        <li>
          <strong><%= format_http_header header_name %>: </strong><%= header_value %>
        </li>
      <% end %>
    </ul>

    <% unless @request_type == 'HEAD' %>
    <h4>Body</h4>
    <div class="row">
      <div class="col-md-12">
        <% if @response_data['headers']['content-type'].include? 'json' %>
          <pre><%= JSON.pretty_generate(JSON.parse(@response_data['body'])) %></pre>
        <% else %>
          <pre><%= h @response_data['body'] %></pre>
        <% end %>
      </div>
    </div>
    <% end %>
  </div>
</div>

Add better JSON format support in response body
Add better JSON format support in response body
