Gets the body of this message.

@param  array $decodeOptions The decoding options.
@return mixed                The formatted body.
771366
public function get($decodeOptions = [])
    {
        $media = $this->_classes['media'];
        $format = $this->format();
        return $format ? $media::decode($format, $this->_stream->toString(), $decodeOptions, $this) : $this->_stream->toString();
    }
464444
public function get_body($uid, $part = 1)
    {
        $headers = $this->get_message_headers($uid);
        return rcube_charset::convert($this->get_message_part($uid, $part, null),
            $headers->charset ?: $this->default_charset);
    }
583102
protected function decodeXml($body)
    {
        try {
            $xml = Xml::build($body, ['return' => 'domdocument', 'readFile' => false]);
            // We might not get child nodes if there are nested inline entities.
            if ((int)$xml->childNodes->length > 0) {
                return Xml::toArray($xml);
            }

            return [];
        } catch (XmlException $e) {
            return [];
        }
    }
433000
private function entityToArray(FormatOptions $formatOptions)
    {
        return [
            'cropX' => $formatOptions->getCropX(),
            'cropY' => $formatOptions->getCropY(),
            'cropWidth' => $formatOptions->getCropWidth(),
            'cropHeight' => $formatOptions->getCropHeight(),
        ];
    }
1367151
public function decode(array $options = [])
    {
        $json = json_decode($this->getContents(), true);

        if ($json === null && json_last_error() === JSON_ERROR_NONE) {
            $this->validateSyntax();

            return $this;
        }

        $this->validateSchema();

        return $json;
    }
1373251
protected function parseBody(array $body)
    {
        $jobs = [];
        if (!empty($body)) {
            if (is_string($body[0])) {
                foreach ($body as $element) {
                    $jobs[] = ['id' => $element];
                }
            } else {
                $keyValueResponse = new KeyValueResponse();
                $keyValueResponse->setCommand($this->command);

                foreach ($body as $element) {
                    $keyValueResponse->setBody($element);
                    $jobs[] = $keyValueResponse->parse();
                }
            }
        }
        return ['jobs' => $jobs];
    }
21840
protected function decodeBodyForFields(array $body, $bodyKey, array $fields)
    {
        if (!isset($body[$bodyKey])) {
            return $body;
        }
        $data = $body[$bodyKey];
        if (!isset($data[0])) {
            $data = array($data);
        }
        foreach ($data as $key => $value) {
            foreach ($fields as $field) {
                if (isset($value[$field])) {
                    $data[$key][$field] = base64_decode($value[$field]);
                }
            }
        }

        if (isset($body[$bodyKey][0])) {
            $body[$bodyKey] = $data;
        } else {
            $body[$bodyKey] = $data[0];
        }

        return $body;
    }
857670
public function getParsedBody()
    {
        if ($this->parsedBody || !$this->body) {
            return $this->parsedBody;
        }
        $type = $this->headers->getContentType();
        $body = (string)$this->getBody();
        switch ($type) {
            case 'application/json':
                $this->parsedBody = json_decode($body, true);
                break;
            case 'application/x-www-form-urlencoded':
                parse_str($body, $data);
                $this->parsedBody = $data;
                break;
            case 'text/xml':
                $disabled = libxml_disable_entity_loader(true);
                $xml = simplexml_load_string($body);
                libxml_disable_entity_loader($disabled);
                $this->parsedBody = $xml;
                break;
            default:
                break;
        }
        return $this->parsedBody;
    }
1301621
public function getResponseBody($encodeEntities = true)
    {
        $body = (string) $this->getResponse()->getBody();

        if ($encodeEntities) {
            return htmlentities($body);
        }

        return $body;
    }
129159
private function decode($result, $requestOptions)
    {
        $format = $requestOptions->getFormat($this->config);
        switch ($this->validateFormat($format)) {
            case 'php':
                $result = unserialize($result);
                break;
            case 'xml':
                $loader = new XmlLoader();
                $domDocument = $loader->loadXml($result);
                $result = simplexml_import_dom($domDocument);
                break;
            case 'json':
            default:
                $result = json_decode($result);
        }

        return $result;
    }
769096
public function getParsedBody()
    {
        if ($this->parsedBody !== false) {
            return $this->parsedBody;
        }

        $mediaType = $this->getMediaType();

        $parts = explode('+', $mediaType);
        if (count($parts) >= 2) {
            $mediaType = 'application/' . $parts[count($parts) - 1];
        }
        unset($parts);

        if (isset($this->bodyParsers[$mediaType])) {
            $body = (string) $this->getBody();
            $parsed = $this->bodyParsers[$mediaType]($body);

            $this->parsedBody = $parsed;

            unset($parsed, $body, $mediaType);

            return $this->parsedBody;
        }

        return null;
    }
462789
private function obtainDecoder(string $decoderId): MessageDecoder
    {
        if (true === $this->decodersLocator->has($decoderId))
        {
            /** @var MessageDecoder $decoder */
            $decoder = $this->decodersLocator->get($decoderId);

            return $decoder;
        }

        throw new \LogicException(
            \sprintf('Could not find decoder "%s" in the service container', $decoderId)
        );
    }
375530
public function getJsonBody($json_options=null) : array
    {
        try {
            return phore_json_decode($bodyRaw = $this->getBody());
        } catch (\InvalidArgumentException $e) {
            throw new \InvalidArgumentException("Cannot json-decode body: '$bodyRaw'", 0, $e);
        }
    }
994284
function extract_params($body) {
		$kvs = explode ( '&', $body );
		$decoded = array ();
		foreach ( $kvs as $kv ) {
			$kv = explode ( '=', $kv, 2 );
			$kv [0] = $this->safe_decode ( $kv [0] );
			$kv [1] = $this->safe_decode ( $kv [1] );
			$decoded [$kv [0]] = $kv [1];
		}
		return $decoded;
	}
248374
public static function parse($options)
    {
        if ($options instanceof self) {
            return $options;
        }

        if (is_null($options)) {
            return new RequestOptions(null, array());
        }

        if (is_string($options)) {
            return new RequestOptions($options, array());
        }

        if (is_array($options)) {
            $headers = array();
            $key = null;
            $signOpts = array();
            if (array_key_exists('api_key', $options)) {
                $key = $options['api_key'];
            }
            if (array_key_exists('pingpp_version', $options)) {
                $headers['Pingpp-Version'] = $options['pingpp_version'];
            }
            if (array_key_exists('sign_opts', $options)) {
                $signOpts = $options['sign_opts'];
            }
            return new RequestOptions($key, $headers, $signOpts);
        }

        $message = 'The second argument to Pingpp API method calls is an '
           . 'optional per-request apiKey, which must be a string, or '
           . 'per-request options, which must be an array. (HINT: you can set '
           . 'a global apiKey by "Pingpp::setApiKey(<apiKey>)")';
        throw new Error\Api($message);
    }
859487
private function parseOptions(array $options)
    {
        if (isset($options['headers']) && is_array($options['headers'])) {
            $this->headers = $options['headers'];
        }

        if (isset($options['scheme']) && strtolower($options['scheme']) === 'http') {
            $this->scheme = 'http';
        }

        if (isset($options['output_format']) && strtolower($options['output_format']) === 'xml') {
            $this->outputFormat = 'xml';
        }
    }
837656
public function getBody($bIsJSON = true)
    {
        if ($bIsJSON) {
            return json_decode($this->oResponse->getBody());
        } else {
            return (string) $this->oResponse->getBody();
        }
    }