Changes

Jump to navigation Jump to search
23 bytes added ,  19:51, 1 July 2013
By default, a successful request is answered with the HTTP status code {{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”).
 
==Custom Responses==
Custom responses can be built from within XQuery by returning an <code>rest:response</code> element, 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. A function that reacts on an unknown resource may look as follows:
</pre>
==Forward Forwards and Redirect=Redirects==
The two XML elements <code>rest:forward</code> and <code>rest:redirect</code> can be used in the context of [[Web Application]]s, precisely in the context of RESTXQ. These nodes allow e.g. multiple [[XQuery Update]]s in a row by redirecting to the RESTXQ path of updating functions. Both wrap a URL to a RESTXQ path. The wrapped URL should be properly encoded via <code>fn:encode-for-uri()</code>.
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu