Gets the response body as an array, if the response body is JSON-encoded
data.  Otherwise, returns null.

@return array|null
559479
public function getResponseData()
    {
        $data = null;

        if ($body = $this->getResponseBody()) {
            if (($decoded = json_decode($body, true))) {
                $data = $decoded;
            }
        }

        return $data;
    }
1365637
public function getBodyParameters() {
        $reqs = array();

        foreach ($this->requests as $r) {
            array_push($reqs, $this->requestToBatchArray($r));
        }

        $result = ['requests' => $reqs];

        if(isset($this->optional['distinctRecomms']))
            $result['distinctRecomms'] = $this->optional['distinctRecomms'];

        return $result;
    }
763699
public function getJSONObject(){
        $result = false;
        $responseHandler = new ResponseHandler();
        if(is_array($this->_lastResponse)){
            $result = $responseHandler->arrayToObject($this->_lastResponse['body']);
        }
        return $result;
    }
1268021
public function jsonSerialize()
    {
        if ($this->getHasDynamicTemplate() == true) {
            $dynamic_substitutions = $this->getSubstitutions();
            $substitutions = null;
        } else {
            $substitutions = $this->getSubstitutions();
            $dynamic_substitutions = null;
        }

        return array_filter(
            [
                'to' => $this->getTos(),
                'cc' => $this->getCcs(),
                'bcc' => $this->getBccs(),
                'subject' => $this->getSubject(),
                'headers' => $this->getHeaders(),
                'substitutions' => $substitutions,
                'dynamic_template_data' => $dynamic_substitutions,
                'custom_args' => $this->getCustomArgs(),
                'send_at' => $this->getSendAt()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
1330393
public static function getBody()
    {
        $contentType = static::getHeader('Content-Type');
        $body = file_get_contents('php://input');

        if (mb_strpos($contentType,'application/x-www-form-urlencoded') === 0) {
            parse_str($body, $data);
            return $data;
        } else if (mb_strpos($contentType, 'application/json') === 0) {
            return json_decode($body, true);
        } else {
            return $body;
        }
    }
175384
public function getDecodedJson():array
    {
        if (!($array = json_decode($this->json, true))) {
            throw new \RuntimeException("Unable to decode the response's JSON");
        }
        return json_decode($this->json, true);
    }
501223
public function getResult()
  {
    // HTTP 204
    if (Response::HTTP_NO_CONTENT == $this->getResponse()
        ->getStatusCode()) {
      return [];
    }

    // Get content
    $contents = $this->getResponse()
      ->getBody()
      ->getContents();
    if (empty($contents)) {
      throw new ResponseDecodeException(
        'Body contents is empty with HTTP code '.$this->getResponse()
          ->getStatusCode()
      );
    }

    // Decode to JSON
    $items = json_decode($contents, true);
    if (JSON_ERROR_NONE != json_last_error()) {
      throw new ResponseDecodeException('JSON error: '.json_last_error_msg());
    }

    return $items;
  }
80775
public function jsonSerialize()
    {
        $data = $this->getData();
        if (empty($data)) {
            return null;
        }
        foreach (array_keys(static::FOREIGN_KEYS) as $column) {
            $data[$column] = $this->__get($column);
        }
        return $data;
    }
199340
public function getParsedResponse()
    {
        // We first get an array representing the response
        $rawData = $this->bodyToArray();

        // If we have a wrapper response object initialized in the current ActionResponse object, then we return it.
        if ($this->responseWrapper instanceof Wrapper\ResponseWrapperInterface) {
            $this->responseWrapper->init($rawData, $this);
            return $this->responseWrapper;
        }
        return $rawData;
    }
274218
public function jsonSerialize()
    {
        return array_filter(
            [
                'group_id' => $this->getGroupId(),
                'groups_to_display' => $this->getGroupsToDisplay()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
383464
private function _getResultData()
    {
        $def = $this->actionChain->getCurrentAction();
        $result = $def['result'];
        if (is_string($result)) {
            return $this->getAttribute($result);
        } elseif (is_array($result)) {
            return array_pop($result);
        } else {
            return null;
        }
    }
1348847
public function getJsonObject()
    {
        // array_filter() ensures that empty values are filtered out
        // array_values() ensures encoding to array rather than object
        $this->sslRoutingRestrictedUrls     = array_values(array_filter($this->sslRoutingRestrictedUrls));
        $this->maintenanceModeAuthorizedIps = array_values(array_filter($this->maintenanceModeAuthorizedIps));

        return json_encode(get_object_vars($this));
    }
900194
public function getJsonBody() : array
    {
        $json = json_decode($this->getRawBody(), true);

        if ($json === null) {
            throw new RuntimeException('Body could not be decoded as JSON');
        }

        return $json;
    }
1052877
public function jsonSerialize()
    {
        return array_filter(
            [
                'click_tracking' => $this->getClickTracking(),
                'open_tracking' => $this->getOpenTracking(),
                'subscription_tracking' => $this->getSubscriptionTracking(),
                'ganalytics' => $this->getGanalytics()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
780804
public function getRequestBody() {
    if (!$this->evaluated) {
      $this->evaluateWebPage();
    }

    if ($this->webPage instanceof JsonPage) {
      $serializer = $this->router->getJsonSerializer();
      return $serializer->serialize($this->rawRequestBody);
    } else {
      return $this->rawRequestBody;
    }
  }
86129
public function getVerboseResponse() 
    {
        $this->execute();
        
        if ($this->error) {
            return $this->error;
        }
        
        $contentType = $this->getContentType();
        
        $body = ($this->def['dataType'] == 'array' || strpos($contentType, 'json') !== false) ? static::data2json($this->responseText) : $this->responseText;
        
        return [
            'status'    => $this->status,
            'body'      => $body, 
            'info'      => $this->responseInfo,
            'header'    => $this->responseHeaders,
            'request_header'    => $this->getRequestHeaders(),
            'content_type'      => $contentType
        ];
    }
991920
public function getBody()
    {
        $body = json_decode($this->response->getBody(), true);

        if (!$body) {
            throw new ResponseWithoutBody('Response without body');
        }

        if (!$this->transformer) {
            return $body;
        }

        return $this->transformer->transformData($body);
    }