Updating expressions using REST?
Hi, I'm having problems with updating expressions using REST. Non-updating queries execute fine without errors but when I use updating expressions the REST service returns a 400 (bad request) error. For instance: the following body of a POST request <run xmlns='http://basex.org/rest'><text>insertDummy.xq</text></run> with code in file insertDummy.xq: xquery version '3.0'; insert node <structure>nada</structure> into collection("component")/structures sent to: http://admin:admin@localhost:8984/rest/component/ returns a "(400) Bad request" error while if I substitute the code in file insertDummy.xq for a non updating expression such as: xquery version '3.0'; let $r := collection("component")/structures return $r it works fine! I suspected this was a result of user rights so I added the admin credentials to the http path. No change, problem persists. Also, I de-installed the program, made sure all files were gone, and then re-installed the (win PC) program again to wipe any weird settings I may have changed. Still no luck... The above code did work on a previous installation (I beleive I was using 7.7.1). Any help would be highly appriciated. Many thanks, Fredrik Hedberg
Hi Fredrik, I just tried our latest 8.0 snapshot [1] and the current 7.8.3-beta branch, but my little test query didn't cause any problems. Do you think you can provide us with a little self-contained example, or some steps how to reproduce the problem? You could additionally activate debugging (-d) and send us the output. Best, Christian __________________________________________ On Mon, Apr 14, 2014 at 10:49 PM, Fredrik Hedberg <fr_hedberg@hotmail.com> wrote:
xquery version '3.0'; insert node <structure>nada</structure> into collection("component")/structures
[1] http://files.basex.org/releases/latest/ [2] https://github.com/BaseXdb/basex/tree/stable
participants (2)
-
Christian Grün -
Fredrik Hedberg