src/Requester.php
public function addFile($filepath, $key = 'file')
    {
        $this->options = array_merge_recursive($this->options, [
            'body' => [
                $key => fopen($filepath, 'r'),
            ],
        ]);

        return $this;
    }
public function addFile($filepath, $key = 'file')
    {
        $this->options = array_merge_recursive($this->options, [
            'body' => [
                $key => fopen($filepath, 'r'),
            ],
        ]);

        return $this;
    }
public function addFile ( $ filepath , $ key = 'file' ) { $ this -> options = array_merge_recursive ( $ this -> options , [ 'body' => [ $ key => fopen ( $ filepath , 'r' ) , ] , ] ) ; return $ this ; }
Add a file to the request.

@param string $filepath path to file
@param string $key      optional post key, default to file

@return \PulkitJalan\Requester\Requester
Add a file to the request .