This page is part of the [[Developer Section]]and belongs to the [[Web Application]] stack. It describes how to use the REST API of BaseX.
BaseX offers a RESTful API for accessing distributed XML resources.
GET, PUT, DELETE, and POST can be used to interact with the database.
=Getting Started= First of all, launch a [[Startup#BaseX HTTP Server|BaseX HTTP Server]]. By default, if [http://jetty.codehaus.org/jetty/ Jetty] is applied as web server, all HTTP REST services will be are available on port <code>8984</code>, and the REST service is accessible via at {{Code|http://localhost:8984/rest/}}. If the server is started as servlet, all [[Options#Main Options|Main Options]] (such as the path to the database) can be configured in the {{Code|web.xml}} file. If run as a standalone application, the settings are stored in the file {{Code|.basex}}. Most browsers can be used to perform simple REST requests and display the response. When requesting the first result, you will have to enter some database credentials (default: <code>admin</code>/<code>admin</code>, [[#User Management|see below]]). Some alternatives for using REST are listed in the [[#Usage Examples|Usage Examples]].
=URL Architecture=