Just to be sure, even though I guess in this case that's most likely that the same problem happens in both cases, I was trying to evaluate the query through a POST, not a GET.
Good to know.. I have now updated the REST code to always set HTTPPATH as query path. This way, server-side modules should be found in the HTTPPATH directory, no matter if you use GET or POST, or if you specify a database. Please have a look at the latest snapshot..
http://files.basex.org/releases/latest/
Thanks, Christian