1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
2
From what you posted, it appears that the response is, in fact, coming back with contents. The response message body is wrapped in a Stream Object (ref: https://docs.guzzlephp.org/en/stable/psr7.html#streams). To read it, you should be able cast or parse it:
$contents = (string) $result->getBody();
or
$contents_json = json_decode($result->getBody());
répondu il y a 2 ans
Contenus pertinents
- demandé il y a 2 mois
- demandé il y a un an
- demandé il y a 7 mois
- AWS OFFICIELA mis à jour il y a 2 ans
Thanks for your help. Actually, your solution almost worked but I just had to change the getBody() method with an associative key because this method was not working.
So, the solution was like this: $contents = (string) $result['Body'] OR $contents_json = json_decode($result['Body']);
Ah, right.. the body itself is in an associative array -- nice catch. Glad to hear that it helped get you on your way!