public function copy(string $fromPath, string $toPath, array $mimeType) : bool
	{
		$fromPath = $this->normalizePath($fromPath);
		
		$toPath = $this->normalizePath($toPath);
		
		// If plain/text, its a folder
		if (substr($mimeType['mimetype'], 0, 4) === 'text') {
			$requestUrl = $this->siteUrl.'/sites/'.$this->siteName.'/_api/Web/GetFolderByServerRelativeUrl(\''.$this->folderPath.$fromPath.'\')/copyTo(strNewUrl=\''.$this->folderPath.$toPath.'\', bOverWrite=true)';
		} else {
			$requestUrl = $this->siteUrl.'/sites/'.$this->siteName.'/_api/Web/GetFileByServerRelativeUrl(\''.$this->folderPath.$fromPath.'\')/copyTo(strNewUrl=\''.$this->folderPath.$toPath.'\', bOverWrite=true)';
		}
		
		$options = [
			'headers' => $this->requestHeaders,
		];
			
		$response = $this->send('POST', $requestUrl, $options);
		
		return $response->getStatusCode() === 200 ? true : false;
	}
public function copy(string $fromPath, string $toPath, array $mimeType) : bool
	{
		$fromPath = $this->normalizePath($fromPath);
		
		$toPath = $this->normalizePath($toPath);
		
		// If plain/text, its a folder
		if (substr($mimeType['mimetype'], 0, 4) === 'text') {
			$requestUrl = $this->siteUrl.'/sites/'.$this->siteName.'/_api/Web/GetFolderByServerRelativeUrl(\''.$this->folderPath.$fromPath.'\')/copyTo(strNewUrl=\''.$this->folderPath.$toPath.'\', bOverWrite=true)';
		} else {
			$requestUrl = $this->siteUrl.'/sites/'.$this->siteName.'/_api/Web/GetFileByServerRelativeUrl(\''.$this->folderPath.$fromPath.'\')/copyTo(strNewUrl=\''.$this->folderPath.$toPath.'\', bOverWrite=true)';
		}
		
		$options = [
			'headers' => $this->requestHeaders,
		];
			
		$response = $this->send('POST', $requestUrl, $options);
		
		return $response->getStatusCode() === 200 ? true : false;
	}
public function copy ( string $ fromPath , string $ toPath , array $ mimeType ) : bool { $ fromPath = $ this -> normalizePath ( $ fromPath ) ; $ toPath = $ this -> normalizePath ( $ toPath ) ; // If plain/text, its a folder if ( substr ( $ mimeType [ 'mimetype' ] , 0 , 4 ) === 'text' ) { $ requestUrl = $ this -> siteUrl . '/sites/' . $ this -> siteName . '/_api/Web/GetFolderByServerRelativeUrl(\'' . $ this -> folderPath . $ fromPath . '\')/copyTo(strNewUrl=\'' . $ this -> folderPath . $ toPath . '\', bOverWrite=true)' ; } else { $ requestUrl = $ this -> siteUrl . '/sites/' . $ this -> siteName . '/_api/Web/GetFileByServerRelativeUrl(\'' . $ this -> folderPath . $ fromPath . '\')/copyTo(strNewUrl=\'' . $ this -> folderPath . $ toPath . '\', bOverWrite=true)' ; } $ options = [ 'headers' => $ this -> requestHeaders , ] ; $ response = $ this -> send ( 'POST' , $ requestUrl , $ options ) ; return $ response -> getStatusCode ( ) === 200 ? true : false ; }
Copy a file or folder to a different location.

https://msdn.microsoft.com/en-us/library/office/jj247198%28v=office.15%29.aspx
Copy a file or folder to a different location .