Guzzle 6: no more json() method for responses

前端 未结 6 1532
悲哀的现实
悲哀的现实 2020-12-02 08:17

Previously in Guzzle 5.3:

$response = $client->get(\'http://httpbin.org/get\');
$array = $response->json(); // Yoohoo
var_dump($array[0][\'origin\']);
         


        
6条回答
  •  孤城傲影
    2020-12-02 08:55

    I use $response->getBody()->getContents() to get JSON from response. Guzzle version 6.3.0.

提交回复
热议问题