File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -330,6 +330,12 @@ following methods::
330330 // gets the response body as a string
331331 $content = $response->getContent();
332332
333+ // casts the response JSON contents to a PHP array
334+ $content = $response->toArray();
335+
336+ // casts the response content to a PHP stream resource
337+ $content = $response->toStream();
338+
333339 // cancels the request/response
334340 $response->cancel();
335341
@@ -339,16 +345,19 @@ following methods::
339345 // you can get individual info too
340346 $startTime = $response->getInfo('start_time');
341347
348+ // returns detailed logs about the requests and responses of the HTTP transaction
349+ $httpLogs = $response->getInfo('debug');
350+
351+ .. versionadded :: 4.4
352+
353+ The ``toStream() `` method was introduced in Symfony 4.4.
354+
342355.. note ::
343356
344357 ``$response->getInfo() `` is non-blocking: it returns *live * information
345358 about the response. Some of them might not be known yet (e.g. ``http_code ``)
346359 when you'll call it.
347360
348- .. tip ::
349-
350- Call ``$response->getInfo('debug') `` to get detailed logs about the HTTP transaction.
351-
352361.. _http-client-streaming-responses :
353362
354363Streaming Responses
You can’t perform that action at this time.
0 commit comments