I am sure that you are trying to send a Response object.
new Response();
it goes into __toString ()
public function __toString()
{
$this->prepare();
return
sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText)."\r\n".
$this->headers."\r\n".
$this->getContent();
}
It's because:
$this->render('template.html.twig');
, :
$response = $this->render('template.html.twig');
$text = $response->getContent();
,