I have:
$result = $client->request('POST', 'http://'.$core_address.':'.$core_port.$core_uri, [
'body' => json_encode([
'a' => $a,
'b' => $value['v'],
'x' => $value['x'],
]),
'headers' => [
'Accept' => 'application/json',
'Content-Type' => 'application/json'
],
]);
$output = json_decode($result->getBody());
i catch the output and print it like:
drupal_set_message($output);
problem is: if output just a flat string, it work like a charm but when it receive json like:
{'x': ['Not a valid integer.'], 't': ['Not a valid string.'], 's': ['Not a valid string.']}
192.168.yyy.xxx - - [28/Jul/2016 00:14:59] "PUT /Module HTTP/1.1" 200 -
it give me error:
Uncaught PHP Exception Exception: "Object of type stdClass cannot be printed." at /path/to/Drupal/Core/Template/TwigExtension.php line 443, referer: https://url.com/admin/core/my/module/path
why? why?