I am trying to run a CURL command from a linux command line that is supposed to move a file to a different folder, according to this manual: Basic APIs — Nextcloud latest Developer Manual latest documentation
First I created the folder:
curl 'https://example.com/remote.php/dav/files/user/recording/2023/02/18' --user 'user:password' --request MKCOL
This works fine, so the basic syntax etc is working.
Then I am trying to move a file to this folder:
curl 'https://example.com/remote.php/dav/files/user/recording/2023-02-18 18-24-52.mp4' --user 'user:password' --request MOVE -H 'Destination:https://example.com/remote.php/dav/files/user/recording/2023/02/18/'
However, on this I am getting a 400 error with “Your browser sent a request that this server could not understand.”. I tried several different sequences in the command (not sure if it matters), short (-X) and long (–request) flags and dropping the last / on the target directory but I could not figure out.
I checked the logfile while having it on DEBUG mode but while the MKCOL call leaves it’s traces there, there is no logfile content AT ALL regarding the MOVE request.
Nextcloud version (eg, 20.0.5): Nextcloud Hub 5 (27.0.1)
Operating system and version (eg, Ubuntu 20.04): Almalinux 9.2
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.53
PHP version (eg, 7.4): PHP 8.2.9