protected function renderBody()
    {
        if (is_scalar($this->payload) || $this->payload === null) {
            return (string)$this->payload;
        }

        if ($this->payload instanceof Stringable) {
            return $this->payload->toString();
        }

        if (is_object($this->payload) && method_exists($this->payload, '__toString')) {
            return (string)$this->payload;
        }

        if (!$this->serializer) {
            throw new UnConfiguredException('No serializer assigned, cannot build the body.');
        }

        return $this->serializer->serialize($this->payload);

    }
protected function renderBody()
    {
        if (is_scalar($this->payload) || $this->payload === null) {
            return (string)$this->payload;
        }

        if ($this->payload instanceof Stringable) {
            return $this->payload->toString();
        }

        if (is_object($this->payload) && method_exists($this->payload, '__toString')) {
            return (string)$this->payload;
        }

        if (!$this->serializer) {
            throw new UnConfiguredException('No serializer assigned, cannot build the body.');
        }

        return $this->serializer->serialize($this->payload);

    }
protected function renderBody ( ) { if ( is_scalar ( $ this -> payload ) || $ this -> payload === null ) { return ( string ) $ this -> payload ; } if ( $ this -> payload instanceof Stringable ) { return $ this -> payload -> toString ( ) ; } if ( is_object ( $ this -> payload ) && method_exists ( $ this -> payload , '__toString' ) ) { return ( string ) $ this -> payload ; } if ( ! $ this -> serializer ) { throw new UnConfiguredException ( 'No serializer assigned, cannot build the body.' ) ; } return $ this -> serializer -> serialize ( $ this -> payload ) ; }
Try to create the body out of the assigned payload.

@return string
Try to create the body out of the assigned payload .