public function getRawContent(int $max_length = -1)
    {
        // Set maximum length based on parameter or provided content_length
        $max_length = $max_length < 0 ? $this->content_length : $max_length;
        // Limit to a maximum of 4MiB
        $max_length = min(4096 * 1024, $max_length, $this->content_length);

        $str = $this->getContentStream();
        $data = stream_get_contents($str, $this->content_length);
        $size = strlen($data);
        if ($size < $max_length)
        {
            self::getLogger()->warning(
                "Less data was posted than promised. Content-length was {} but only {} bytes were received",
                [$this->content_length, $size]
            );
        }
        return $data;
    }
public function getRawContent(int $max_length = -1)
    {
        // Set maximum length based on parameter or provided content_length
        $max_length = $max_length < 0 ? $this->content_length : $max_length;
        // Limit to a maximum of 4MiB
        $max_length = min(4096 * 1024, $max_length, $this->content_length);

        $str = $this->getContentStream();
        $data = stream_get_contents($str, $this->content_length);
        $size = strlen($data);
        if ($size < $max_length)
        {
            self::getLogger()->warning(
                "Less data was posted than promised. Content-length was {} but only {} bytes were received",
                [$this->content_length, $size]
            );
        }
        return $data;
    }
public function getRawContent ( int $ max_length = - 1 ) { // Set maximum length based on parameter or provided content_length $ max_length = $ max_length < 0 ? $ this -> content_length : $ max_length ; // Limit to a maximum of 4MiB $ max_length = min ( 4096 * 1024 , $ max_length , $ this -> content_length ) ; $ str = $ this -> getContentStream ( ) ; $ data = stream_get_contents ( $ str , $ this -> content_length ) ; $ size = strlen ( $ data ) ; if ( $ size < $ max_length ) { self :: getLogger ( ) -> warning ( "Less data was posted than promised. Content-length was {} but only {} bytes were received" , [ $ this -> content_length , $ size ] ) ; } return $ data ; }
Get the raw content as a string

@param int $max_length The maximum amount of bytes to read.
@return string The read data
Get the raw content as a string