public function addPostFile($key, $file, $content = null)
    {
        $this->setMethod('POST');
        $this->setBody(null);
        if ($content === null && is_file($file)) {
            $content = @file_get_contents($file);
        }
        $this->_postFiles[$key] = [basename($file), $content];
    }
public function addPostFile($key, $file, $content = null)
    {
        $this->setMethod('POST');
        $this->setBody(null);
        if ($content === null && is_file($file)) {
            $content = @file_get_contents($file);
        }
        $this->_postFiles[$key] = [basename($file), $content];
    }
public function addPostFile ( $ key , $ file , $ content = null ) { $ this -> setMethod ( 'POST' ) ; $ this -> setBody ( null ) ; if ( $ content === null && is_file ( $ file ) ) { $ content = @ file_get_contents ( $ file ) ; } $ this -> _postFiles [ $ key ] = [ basename ( $ file ) , $ content ] ; }
Add file to be uploaded for request use POST
@param string $key field name.
@param string $file file path to be uploaded.
@param string $content file content, default to null and read from file.
Add file to be uploaded for request use POST