public function setBody($body)
    {
        if (is_string($body)) {
            return $this->setStringBody($body);
        }

        if (!is_resource($body)) {
            throw new InvalidArgumentException('Body must be a stream !');
        }
        if (!stream_is_local($body)) {
            throw new InvalidArgumentException('Body must be a local stream !');
        }

        rewind($body);
        $this->body = $body;
    }
public function setBody($body)
    {
        if (is_string($body)) {
            return $this->setStringBody($body);
        }

        if (!is_resource($body)) {
            throw new InvalidArgumentException('Body must be a stream !');
        }
        if (!stream_is_local($body)) {
            throw new InvalidArgumentException('Body must be a local stream !');
        }

        rewind($body);
        $this->body = $body;
    }
public function setBody ( $ body ) { if ( is_string ( $ body ) ) { return $ this -> setStringBody ( $ body ) ; } if ( ! is_resource ( $ body ) ) { throw new InvalidArgumentException ( 'Body must be a stream !' ) ; } if ( ! stream_is_local ( $ body ) ) { throw new InvalidArgumentException ( 'Body must be a local stream !' ) ; } rewind ( $ body ) ; $ this -> body = $ body ; }
Set body with stream acceptance
@param resource|string $body Request body
@throws InvalidArgumentException
Set body with stream acceptance