private function addBody(MessageInterface $request, $message)
    {
        $stream = $request->getBody();
        if (!$stream->isSeekable() || 0 === $this->maxBodyLength) {
            // Do not read the stream
            return $message."\n";
        }

        if (null === $this->maxBodyLength) {
            $message .= "\n".$stream->__toString();
        } else {
            $message .= "\n".mb_substr($stream->__toString(), 0, $this->maxBodyLength);
        }

        $stream->rewind();

        return $message;
    }
private function addBody(MessageInterface $request, $message)
    {
        $stream = $request->getBody();
        if (!$stream->isSeekable() || 0 === $this->maxBodyLength) {
            // Do not read the stream
            return $message."\n";
        }

        if (null === $this->maxBodyLength) {
            $message .= "\n".$stream->__toString();
        } else {
            $message .= "\n".mb_substr($stream->__toString(), 0, $this->maxBodyLength);
        }

        $stream->rewind();

        return $message;
    }
private function addBody ( MessageInterface $ request , $ message ) { $ stream = $ request -> getBody ( ) ; if ( ! $ stream -> isSeekable ( ) || 0 === $ this -> maxBodyLength ) { // Do not read the stream return $ message . "\n" ; } if ( null === $ this -> maxBodyLength ) { $ message .= "\n" . $ stream -> __toString ( ) ; } else { $ message .= "\n" . mb_substr ( $ stream -> __toString ( ) , 0 , $ this -> maxBodyLength ) ; } $ stream -> rewind ( ) ; return $ message ; }
Add the message body if the stream is seekable.

@param MessageInterface $request
@param string           $message

@return string
Add the message body if the stream is seekable .