Database Reference
In-Depth Information
This shows the available arguments for using the StoreApp.
A complete example of using the application might look like the following, which
would upload the file /tmp/large.xml to the collection /db/my-new-collection in eXist:
java -jar webdav-client-store/target/webdav-client-store-1.0-example.jar
localhost 8080 /tmp/large.xml /db/my-new-collection admin
You can execute the RetrieveApp example like so:
java -jar webdav-client-retrieve/target/webdav-client-store-1.0-example.jar
This shows the available arguments for using the RetrieveApp.
A complete example of using the application might look like the following, which
would download the resource /db/some-document.xml to the file in the current direc‐
tory named some-document.xml :
java -jar webdav-client-retrieve/target/webdav-client-retrieve-1.0-example.jar
localhost 8080 /db/some-document.xml admin > some-document.xml
REST Server API
The REST Server in eXist offers a REST-like API that enables you to both manipulate
the contents of the database and also send queries to be executed against the contents
of the database. This section looks at the REST Server API in detail and also provides
information for programmers who may like to integrate with eXist. If you are looking
to get started with the REST Server, then you should first read “Querying the Data‐
base Using REST” on page 94 .
In addition, and perhaps more interestingly, the REST Server API allows you to pre-
store XQuery (and XProc) resources into the database and then execute them by
calling them by URI. The entire HTTP request and response are made available to
your XQuery, enabling you to determine processing dynamically in your XQuery
based on parameters of the HTTP request and create your own HTTP response. This
mechanism allows you to build complete and versatile web applications in XQuery;
see “Executing stored queries” on page 335 and Chapter 9 for further details. For a com‐
plete illustration of the operations provided by the REST Server, see Appendix B .
There are many tools, programming languages, and libraries that allow you to inter‐
act with a REST API (including web browsers, to a limited extent), but in these exam‐
ples we will show you how to use cURL . We'll also provide some simple examples in
Java in “Using the REST Server API from Java” on page 339 .
Retrieving collections and documents
The base URI of the REST Server in eXist on a default installation is http://localhost:
8080/exist/rest/db .
Search WWH ::




Custom Search