Skip to content

[HttpClient] Mention extra.trace_content option #16894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions http_client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,25 @@ ensure local networks are made inaccessible to the HTTP client::
// but all the other requests, including other internal networks, will be allowed
$client = new NoPrivateNetworkHttpClient(HttpClient::create(), ['104.26.14.0/23']);

Profiling
~~~~~~~~~

When you are using the :class:`Symfony\\Component\\HttpClient\\TraceableHttpClient`,
responses content will be kept in memory and may exhaust it.

You can disable this behavior by setting the ``extra.trace_content`` option to ``false``
in your requests::

$response = $client->request('GET', 'https://...', [
'extra' => ['trace_content' => false],
]);

This setting won’t affect other clients.

.. versionadded:: 5.2

The ``extra.trace_content`` option was introduced in Symfony 5.2.

Performance
-----------

Expand Down