{% 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 %} {{ 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 %}
{{ trace.method }} {{ trace.url }} {% if trace.options is not empty %} {{ profiler_dump(trace.options, maxDepth=1) }} {% endif %}
{% 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) }}
{% endfor %} {% endif %}
{% endfor %} {% endif %}
{% endblock %}