{% extends '@WebProfiler/Profiler/layout.html.twig' %} {% block toolbar %} {% if collector.requestCount %} {% set icon %} {{ include('@WebProfiler/Icon/http-client.svg') }} {% set status_color = '' %} {{ collector.requestCount }} {% endset %} {% set text %}
Total requests {{ collector.requestCount }}
HTTP errors {{ collector.errorCount }}
{% endset %} {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status_color }) }} {% endif %} {% endblock %} {% block menu %} {{ include('@WebProfiler/Icon/http-client.svg') }} HTTP Client {% if collector.requestCount %} {{ collector.requestCount }} {% endif %} {% endblock %} {% block panel %}

HTTP Client

{% if collector.requestCount == 0 %}

No HTTP requests were made.

{% else %}
{{ collector.requestCount }} Total requests
{{ collector.errorCount }} HTTP errors

Clients

{% for name, client in collector.clients %}

{{ name }} {{ client.traces|length }}

{% if client.traces|length == 0 %}

No requests were made with the "{{ name }}" service.

{% else %}

Requests

{% for trace in client.traces %} {% set profiler_token = '' %} {% set profiler_link = '' %} {% if trace.info.response_headers is defined %} {% for header in trace.info.response_headers %} {% if header matches '/^x-debug-token: .*$/i' %} {% set profiler_token = (header.getValue | slice('x-debug-token: ' | length)) %} {% endif %} {% if header matches '/^x-debug-token-link: .*$/i' %} {% set profiler_link = (header.getValue | slice('x-debug-token-link: ' | length)) %} {% endif %} {% endfor %} {% endif %} {% if profiler_token and profiler_link %} {% endif %} {% if profiler_token and profiler_link %} {% endif %}
{{ trace.method }} {{ trace.url }} {% if trace.options is not empty %} {{ profiler_dump(trace.options, maxDepth=1) }} {% endif %} Profile
{% if trace.http_code >= 500 %} {% set responseStatus = 'error' %} {% elseif trace.http_code >= 400 %} {% set responseStatus = 'warning' %} {% else %} {% set responseStatus = 'success' %} {% endif %} {{ trace.http_code }} {{ profiler_dump(trace.info, maxDepth=1) }} {{ profiler_token }}
{% endfor %} {% endif %}
{% endfor %} {% endif %}
{% endblock %}