I can't read data from a Response object Cakephp4

I need to read some data from a http URL with contains this data: {“result”:[{“reg”:408,“val”:670,“mod”:5}]}

I’ve done this in my Controller:

public function param(){
    $http = new Client();
    $response = $http->get('my https');
    $json = $response->getJson();
    $this->set("json", "$json");


And in my php file:

<!DOCTYPE html>
    <title>Here the data</title>
     <td><?php  echo $json; ?></td>

But I receive the error: “Array to string conversion” in my Controller for the $this->set("json", "$json"); And in the php, it returns “Array” Why? How can I return the values?

Please try to avoid crossposting, this will inadvertently lead to someone somewhere wasting their time with trying to solve your problem - thanks!