Thanks, I did see those, but I would like to have the REST way, where the URI identifies the resource, which in this case is defined by an XQuery, and the request entity is the application data.
So,
POST /rest/foo?run=abc.xql
<order>
<topping>cheese</topping>
<topping>pepperoni</topping>
</order>
So the RESTPost would support ?run.
A better way might be to allow a separate mapping of resources to XQuery files, so maybe I will take a look at that.
Leigh.
> I see that REST GET request supports the ?run=foo.xq style, which allows a
> GET to be handled by a pre-defined XQuery file. See
> http://docs.basex.org/wiki/REST#GET_Requests
>
> However, the REST POST (and other) requests do not support it.
You may be gratified to hear that POST also supports the RUN
operation. I've added a small example to the documentation:
http://docs.basex.org/wiki/REST#POST_Requests
> With support for XUpdate in BaseX, it is important to have the ability to
> POST (or PUT) application-defined data to a server-side XQuery, rather
> than having the client have to post the entire query.
This is possible by adding a <rest:context/> element to your POST
request. The element contents will then available as the context item
of the server-side query; e.g.:
<rest:run xmlns:rest="http://www.basex.org/rest">
<rest:text>query.xq</rest:text>
<rest:context>
<xml>
<text>Hello</text>
<text>World</text>
</xml>
</rest:context>
</rest:run>
Hope this helps,
Christian