public function getData()
{
if (!$this->isValid()) {
throw new InvalidQueryException($this->response->getBody(), $this);
}
$body = $this->response->getBody();
if (null === ($json = json_decode($body))) {
if ($this->isValidRid($body)) {
return $body;
} elseif ($body === "") {
return true;
}
throw new \RuntimeException("Invalid JSON payload");
}
return $json;
}