Amp\Artax\FileBody::getBody PHP Method

getBody() public method

Retrieve the sendable Amp\Artax entity body representation
public getBody ( ) : Amp\Promise
return Amp\Promise
    public function getBody()
    {
        // @TODO Implement non-blocking php-uv iterator.
        // For now we'll just use the dumb blocking version.
        // v1.0.0 cannot be a thing until this is implemented.
        if ($resource = @fopen($this->path, 'r')) {
            return new Success(new ResourceIterator($resource));
        } else {
            return new Failure(new \RuntimeException(sprintf('Failed opening file resource: %s', $this->path)));
        }
    }