Monday, May 9, 2011

Using curl with eXist to perform XQuery

Simple trick to use HTTP POST with curl to do an XQuery - (I struggled for a bit with the Content-type)

curl --header "Content-type: text/xml" --data "@x.xml" http://hostname:8080/exist/rest/db/

where x.xml is something like:

<?xml version="1.0" encoding="UTF-8"?>
<query xmlns="" start="1" max="20">
  some XQuery here...
  <property name="indent" value="yes"/>

No comments:

Post a Comment