Hello all,
I am trying to copy (duplicate) an existing document via REST API, but can not get it working.
I tried via POST as commands. Can somebody please provide me a working example ?
My use case is simply duplicate an existing document in a databse, as a backup file.
From the documentation: <add (path='...')>[input]</add>,
I translated it to xml command similar:
<commands> <command>OPEN db</command> <command>ADD copy.xml source.xml</command> </commands>
with diffferent variations, like adding path argument etc.
However, in the end I got nothing working. I also tried it via xquery,
but I would prefer xml like above. But in the end I am happy with any working example.
Two more questions in that context. What is the recommended header Content-Type xml or text/plain?
Does it make sense rto use the http://basex_rest_url/?command url or just the REST URL?
I am pretty sure, there is an easy solution for copying documents, so any help on this is appreciated.
Thank you in advance
Alexander Liedtke