Amp\Artax\FileBody::getHeaders PHP Method

getHeaders() public method

Return a key-value array of headers to add to the outbound request
public getHeaders ( ) : Amp\Promise
return Amp\Promise
    public function getHeaders()
    {
        // @TODO Implement non-blocking php-uv header retrieval.
        // For now we'll just use the dumb blocking version.
        // v1.0.0 cannot be a thing until this is implemented.
        $promisor = new Deferred();
        $this->getLength()->when(function ($error, $result) use($promisor) {
            if ($error) {
                $promisor->fail($error);
            } else {
                $promisor->succeed(['Content-Length' => $result]);
            }
        });
        return $promisor->promise();
    }