Guzzlehttp – How get the body of a response from Guzzle 6?

Guzzle implements PSR-7. That means that it will by default store the body of a message in a Stream that uses PHP temp streams. To retrieve all the data, you can use casting operator: $contents = (string) $response->getBody(); You can also do it with $contents = $response->getBody()->getContents(); The difference between the two approaches is that … Read more