you have created a database instance from the [http://files.basex.org/xml/factbook.xml factbook.xml] document:
:<code>[http://localhost:8984/rest http://localhost:8984/rest]</code>
<pre class="brush:xml">
In the given example, a single XML document is stored in the ''factbook'' database:
:<code>[http://localhost:8984/rest/factbook http://localhost:8984/rest/factbook]</code>
<pre class="brush:xml">
The contents of a database can be retrieved by directly addressing the resource:
:<code>[http://localhost:8984/rest/factbook/factbook.xml http://localhost:8984/rest/factbook/factbook.xml]</code>
If a resource is not found, an HTTP response will be generated with <code>404</code> as status code.
; Examples
* The first example lists all resources found in the '''tmp''' path of the ''xmark'' database:<br/><code>[http://localhost:8984/rest/factbook/tmp http://localhost:8984/rest/factbook/tmp]</code>
* The first example prints the city names from the ''factbook'' database and encloses all results with a <code><rest:result/></code> elements:<br/><code>[http://localhost:8984/rest/factbook?query=//city/name&wrap=yes http://localhost:8984/rest/factbook?query=//city/name&wrap=yes]</code>
* In the next request, <code>US-ASCII</code> is chosen as output encoding, and the query <code>eval.xq</code> is evaluated:<br/><code>[http://localhost:8984/rest?run=eval.xq&encoding=US-ASCII http://localhost:8984/rest?run=eval.xq&encoding=US-ASCII]</code>
* The next URL turns on XML wrapping and lists all database users that are known to BaseX:<br/><code>[http://localhost:8984/rest?command=show+users http://localhost:8984/rest?command=show+users]</code>
===POST Requests===