Gets post body content

@return string
518132
public function getBody()
    {
        if (!isset($this->body)) {
            if (function_exists('http_get_request_body')) {
                $this->body = http_get_request_body();
            } else {
                $this->body = @file_get_contents('php://input');
            }
        }
        return $this->body;
    }
321327
protected function parseBody()
    {
        // Remove the function signature and outer braces
        $start  = strpos($this->code, '{');
        $finish = strrpos($this->code, '}');
        $body   = ltrim(rtrim(substr($this->code, $start + 1, $finish - $start - 1)), "\n");

        return $body;
    }
541727
public function getBodyAsString(): string
    {
        $body = $this->getBody();
        if (is_string($body)) {
            return $body;
        }
        if (null === $body) {
            return '';
        }
        if (is_callable($body)) {
            ob_start();
            $body();

            return ob_get_clean();
        }
        /**
         * @var string|int|null
         */
        $contentLength = $this->getHeader('Content-Length');
        if (is_int($contentLength) || ctype_digit($contentLength)) {
            return stream_get_contents($body, (int) $contentLength);
        }

        return stream_get_contents($body);
    }
580568
public function bodyToArray()
    {
        // Getting response content
        $jsonContent = $this->response->getContent();

        // Wrapping it into a Json reader object and convert it to array
        $jsonReader = new Json();
        return $jsonReader->fromString($jsonContent);
    }
983816
public function getBody()
    {
        $bodyObject = $this->response->getBody();

        $bodyObject->rewind();

        $length = $bodyObject->getContentLength();
        if ($length === false || $length <= 0) {
            return '';
        }

        return $bodyObject->read($length);
    }
805157
public function getBody()
    {
        if ($this->isMultiPart()) {
            throw new \LogicException("MultiPart content, there aren't body");
        }

        $body = stream_get_contents($this->stream, -1, $this->bodyOffset);

        // Decode
        $encoding = strtolower($this->getHeader('Content-Transfer-Encoding'));
        switch ($encoding) {
            case 'base64':
                $body = base64_decode($body);
                break;
            case 'quoted-printable':
                $body = quoted_printable_decode($body);
                break;
        }

        // Convert to UTF-8 ( Not if binary or 7bit ( aka Ascii ) )
        if (false === in_array($encoding, array('binary', '7bit'))) {
            // Charset
            $contentType = $this->getHeader('Content-Type');
            $charset = self::getHeaderOption($contentType, 'charset');
            if (null === $charset) {
                // Try to detect
                $charset = mb_detect_encoding($body) ?: 'utf-8';
            }

            // Only convert if not UTF-8
            if ('utf-8' !== strtolower($charset)) {
                $body = mb_convert_encoding($body, 'utf-8', $charset);
            }
        }

        return $body;
    }
991453
public function returnBody()
    {
        $body = $this->getBody();
        $text = '';

        if ($body->hasChildNodes()) {
            foreach ($body->childNodes as $child) {
                $text .= $this->dom->saveXML($child);
            }
        }

        return Horde_String::convertCharset($text, 'UTF-8', $this->_origCharset);
    }
30617
protected function getBody()
    {

        $body = $this->body;

        if (count($this->_source)) {

            $_source = array_key_exists("_source", $body) ? $body["_source"] : [];

            $body["_source"] = array_unique(array_merge($_source, $this->_source));
        }

        if (count($this->must)) {
            $body["query"]["bool"]["must"] = $this->must;
        }

        if (count($this->must_not)) {
            $body["query"]["bool"]["must_not"] = $this->must_not;
        }

        if (count($this->filter)) {
            $body["query"]["bool"]["filter"] = $this->filter;
        }

        if (count($this->sort)) {

            $sortFields = array_key_exists("sort", $body) ? $body["sort"] : [];

            $body["sort"] = array_unique(array_merge($sortFields, $this->sort), SORT_REGULAR);

        }

        $this->body = $body;

        return $body;
    }
239966
public function getArticleBody(): Generator
    {
        yield from $this->sendCommand(new Command('BODY'));
        return yield from $this->encoder->readData($this->stream);
    }
493109
protected function getBody()
    {
        $data = $this->form->data();

        unset($data[self::EMAIL_KEY]);
        unset($data[self::RECEIVE_COPY_KEY]);
        $body = '';
        foreach ($data as $key => $value) {
            if (is_array($value)) {
                $value = implode(', ', array_filter($value, function ($i) {
                    return $i !== '';
                }));
            }

            $body .= ucfirst($key).': '.$value."\n\n";
        }

        return $body;
    }
1297672
public function getBody()
    {
        $streamResource = fopen('php://memory', 'r+');
        if (is_resource($this->content)) {
            stream_copy_to_stream($this->content, $streamResource);
        } else {
            fwrite($streamResource, $this->content);
        }
        rewind($streamResource);

        return new ContentStream($streamResource);
    }
608855
public function getPageContent()
    {
        $response = Director::test($this->owner->Link());

        if (!$response->isError()) {
            return $response->getBody();
        }

        return '';
    }
420540
public function getRawBody()
    {
        if (null === $this->_rawBody) {
            $body = file_get_contents('php://input');

            if (strlen(trim($body)) > 0) {
                $this->_rawBody = $body;
            } else {
                $this->_rawBody = false;
            }
        }
        return $this->_rawBody;
    }
1161407
public function getProcessedBody()
    {
        $r = preg_split(MailImporter::getMessageBodyHashRegularExpression(), $this->body);
        $message = $r[0];
        $r = preg_replace(array(
            '/^On (.*) at (.*), (.*) wrote:/sm',
            '/[\n\r\s\>]*\Z/i',
        ), '', $message);

        return $r;
    }
607101
public function body()
	{
		$msg = $this->getMessage();
		
		if (422 == $this->getCode() && !empty($msg)) {
			$this->extra['errors'] = json_decode($msg, true);
			$msg = null;
		}
		
		if (empty($msg)) {
			switch ($this->getCode()) {
				case 404:
					$msg = 'Not Found';
					break;
				case 405:
					$msg = 'Method Not Allowed';
					break;
				case 400:
					$msg = 'Bad Request';
					break;
				case 401:
					$msg = 'Unauthorized';
					break;
				case 402:
					$msg = 'Payment Required';
					break;
				case 403:
					$msg = 'Forbidden';
					break;
				case 422:
					$msg = 'Unprocessable Entity';
					break;
				case 410:
					$msg = 'Resource Deleted';
					break;
				case 500:
					$msg = 'Server Error';
					break;
				default:
					$msg = 'Error';
			}
		}
		
		$output = array(
			'status'  => $this->getCode(),
			'message' => $msg,
		);
		
		if (!empty($this->getExtra())) {
			$output = array_merge($output, $this->getExtra());
		}
		
		return $output;
	}
1349953
protected static function getPostData()
    {
        $post_data = '-';
        if(!empty($_POST))
        {
            /*
             * Clean posted data to hide passwords
            */
            $password_subtexts = ['password', 'pwd'];

            $post = $_POST;

            foreach($post as $field => $value)
            {
                if(is_string($value))
                {
                    foreach($password_subtexts as $password_subtext){
                        if(stripos($field, $password_subtext) !== false){
                            $post[$field] = '*****';
                        }
                    }
                }
                elseif(is_array($value))
                {
                    foreach($value as $f => $v)
                    {
                        if(is_string($v))
                        {
                            foreach($password_subtexts as $password_subtext){
                                if(stripos($f, $password_subtext) !== false){
                                    $post[$field][$f] = '*****';
                                }
                            }
                        }
                    }
                }
            }

            $post_data = json_encode($post);

            return $post_data;
        }
    }
3433
public function bodyToArray()
    {
        // Getting response content
        $xmlContent = $this->response->getContent();

        // Wrapping it into a Xml reader object and convert it to array
        $xmlReader = new Xml();
        return $xmlReader->fromString($xmlContent);
    }