1 Antwort
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
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());
beantwortet vor 2 Jahren
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 3 Jahren
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!