You are here

public function DrupalGatherContentClient::getBody in GatherContent 8.4

Same name and namespace in other branches
  1. 8.5 src/DrupalGatherContentClient.php \Drupal\gathercontent\DrupalGatherContentClient::getBody()

Returns the response body.

Parameters

bool $json_decoded: If TRUE the method will return the body json_decoded.

Return value

\Psr\Http\Message\StreamInterface Response body.

File

src/DrupalGatherContentClient.php, line 103

Class

DrupalGatherContentClient
Extends the GatherContentClient class with Drupal specific functionality.

Namespace

Drupal\gathercontent

Code

public function getBody($json_decoded = FALSE) {
  $body = $this
    ->getResponse()
    ->getBody();
  if ($json_decoded) {
    return \GuzzleHttp\json_decode($body);
  }
  return $body;
}