=Response=
By default, a successful request is answered with the HTTP status code "200 OK", and is followed by the given content; an erroneous request leads to an error code and an optional error message (e.g. {{Code|404}} for “resource not found”). Compare [http://en.wikipedia.org/wiki/List_of_HTTP_status_codes List of HTTP status codes] to see what status code fits.
Custom responses can be built from within XQuery by returning an <code>rest:response</code>, an <code>http:response</code> child node that matches the syntax of the [http://expath.org/spec/http-client EXPath HTTP Client Module] specification, and more optional child nodes that will be serialized as usual. E.g. one may return to the client
</pre>
Compare [httpErrors outside RESTXQ can be handled by adding {{Code|error-page}} elements to the {{Code|web.xml}} configuration file. An example: <pre class="brush:xml"><!-- Error handling --><error-page> <error-code>404</error-code> <location>/error404</en.wikipedia.orglocation></wikierror-page></List_of_HTTP_status_codes List of HTTP status codes] to see what status code fits.pre>
=Forward and Redirect=