Skip to content

Commit 844987a

Browse files
author
Mathieu Lechat
committed
[HttpClient] Mention extra.trace_content option
1 parent 60dd7c6 commit 844987a

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

http_client.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,22 @@ Alternatively, you can also disable ``verify_host`` and ``verify_peer`` (see
779779
:ref:`http_client config reference <reference-http-client>`), but this is not
780780
recommended in production.
781781

782+
Profiling
783+
~~~~~~~~~
784+
785+
When you are using the :class:`Symfony\\Component\\HttpClient\\TraceableHttpClient`
786+
responses content will be kept in memory, which can cause different issues.
787+
788+
You can disable this behavior by setting the ``extra.trace_content`` to ``false``
789+
in your requests’ options::
790+
791+
$response = $client->request('GET', 'https://...', [
792+
'extra' => ['trace_content' => false],
793+
]);
794+
795+
This setting won’t have any effect with other clients.
796+
797+
782798
Performance
783799
-----------
784800

@@ -1273,7 +1289,7 @@ Symfony's HTTP client provides an EventSource implementation to consume these
12731289
server-sent events. Use the :class:`Symfony\\Component\\HttpClient\\EventSourceHttpClient`
12741290
to wrap your HTTP client, open a connection to a server that responds with a
12751291
``text/event-stream`` content type and consume the stream as follows::
1276-
1292+
12771293
use Symfony\Component\HttpClient\Chunk\ServerSentEvent;
12781294
use Symfony\Component\HttpClient\EventSourceHttpClient;
12791295

0 commit comments

Comments
 (0)