{% extends wrapper_template %}
{% block content %}
<div class="container">
    <div class="restclients-proxy">

        <div class="row restclients-header">
            <div class="col-md-8 restclients-header-url"><span class="glyphicon glyphicon-stats"></span><input type="input" class="form-control input-sm" id="restclients-proxy-url" value="{{ url }}" disabled></div>
            <div class="col-md-2" style="text-align:center; width:auto;">
                <span class="label" style="color:#999;">TIME</span> <span class="label label-default">{{ time_taken }}</span>
            </div>
            <div class="col-md-2" style="text-align:center; width:auto;">
                <span class="label" style="color:#999;">STATUS</span> <span class="label label-default">{{ response_code }}</span>
            </div>
        </div>

        <div class="restclients-response-content">
            {% if search_template %}{% include search_template %}{% endif %}
            {% if use_pre %}<pre>{% endif %}
            {{ content|safe }}
            {% if use_pre %}</pre>{% endif %}
            {% if is_image %}
                <img src="data:image/jpeg;base64, {{ base_64 }}"/>
            {% endif %}
        </div>

        <div class="restclients-footer">
        <b>Headers:</b><br/>
        {% for key, val in headers.items %}
            <b>{{ key }}</b>: {{ val }}<br/>
        {% endfor %}
        </div>

    </div>
</div>
{% endblock content %}

{% block extra_js %}
{{ block.super }}
{% if json_data %}
<script type="text/javascript">
    window.restclients_json_data = {{json_data|safe}};
</script>
{% endif %}
{% endblock extra_js %}
