Search code examples
restcurlbasex

How to call a command (e.g. OPTIMIZE)?


I am using cURL to interact using the REST interface of BaseX to get resources, delete resources, put new resources, etc. like this: http://docs.basex.org/wiki/REST#Command_Line

Is there any way to call OPTIMIZE using that REST interface?


Solution

  • Commands like OPTIMIZE can be called like this:

    curl http://localhost:8984/rest/factbook?command=optimize
    

    If the command contains a space, it must be URL escaped to +, e.g. for OPTIMIZE ALL:

    curl http://localhost:8984/rest/factbook?command=optimize+all