0
$client = new \GuzzleHttp\Client();
$res = $client->request('GET', 'http://127.0.0.1/slim_project/getall',
        array(
                'headers' => array(
                    'Authorization' => "Bearer fghfghfgh-sdfsdfs-sdfsdf}",
                )
            )
        );

$data = $response->withBody($res->getBody());
return $this->renderer->render($data->getBody(), 'pages/tables.php');

When i run the code. i got this error.

Argument 1 passed to Slim\Views\PhpRenderer::render() must implement interface Psr\Http\Message\ResponseInterface, instance of GuzzleHttp\Psr7\Stream given, called in /var/www/html/slim_project/index.php on line 101 and defined

How Can i convert Guzzle to psr/http\message. That how can i use this.

Thanks in advance.

Mahabub
  • 51
  • 4
  • Do you need to render pages/tables.php? the first parameter to the render method ist $response so add it there – jmattheis Feb 07 '17 at 12:39

1 Answers1

0

return $this->renderer->render($response, 'pages/tables.php', json_decode($data->getBody(), true));

Mahabub
  • 51
  • 4