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::
341341 // gets the response body as a string
342342 $content = $response->getContent();
343343
344+ // casts the response JSON contents to a PHP array
345+ $content = $response->toArray();
346+
344347 // cancels the request/response
345348 $response->cancel();
346349
@@ -350,16 +353,15 @@ following methods::
350353 // you can get individual info too
351354 $startTime = $response->getInfo('start_time');
352355
356+ // returns detailed logs about the requests and responses of the HTTP transaction
357+ $httpLogs = $response->getInfo('debug');
358+
353359.. note ::
354360
355361 ``$response->getInfo() `` is non-blocking: it returns *live * information
356362 about the response. Some of them might not be known yet (e.g. ``http_code ``)
357363 when you'll call it.
358364
359- .. tip ::
360-
361- Call ``$response->getInfo('debug') `` to get detailed logs about the HTTP transaction.
362-
363365.. _http-client-streaming-responses :
364366
365367Streaming Responses
You can’t perform that action at this time.
0 commit comments