File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -341,6 +341,9 @@ following methods::
341
341
// gets the response body as a string
342
342
$content = $response->getContent();
343
343
344
+ // casts the response JSON contents to a PHP array
345
+ $content = $response->toArray();
346
+
344
347
// cancels the request/response
345
348
$response->cancel();
346
349
@@ -350,16 +353,15 @@ following methods::
350
353
// you can get individual info too
351
354
$startTime = $response->getInfo('start_time');
352
355
356
+ // returns detailed logs about the requests and responses of the HTTP transaction
357
+ $httpLogs = $response->getInfo('debug');
358
+
353
359
.. note ::
354
360
355
361
``$response->getInfo() `` is non-blocking: it returns *live * information
356
362
about the response. Some of them might not be known yet (e.g. ``http_code ``)
357
363
when you'll call it.
358
364
359
- .. tip ::
360
-
361
- Call ``$response->getInfo('debug') `` to get detailed logs about the HTTP transaction.
362
-
363
365
.. _http-client-streaming-responses :
364
366
365
367
Streaming Responses
You can’t perform that action at this time.
0 commit comments