Changes

Jump to navigation Jump to search
10 bytes removed ,  22:15, 10 November 2012
=Forward and Redirect=
 With {{Version|7.5}} , we introduce two XML elements: <code>restxq:forward</code> and <code>restxq:responseredirect</code>. They are not part of RESTXQ-spec specification yet and can be returned 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 an URL to a RESTXQ path.
Remember to encode the wrapped URL, e.g. using <code>fn:encode-for-uri()</code>.
==<code>restxq:forward</code>== 
Usage: wrap the location as follows
<pre class="brush:xquery"><restxq:forward>{ $location }</restxq:forward></pre>
This results in a serverside server-side forwarding, which as well reduces traffic among client and server. A forward forwarding of this kind will not change the URL seen from the clients client's perspective.
As an example, returning
would internally forward to http://localhost:8984/restxq/hello/universe
==<code>restxq:redirect</code>==
<pre class="brush:xquery"><restxq:redirect>{ $location }</restxq:redirect></pre>
</pre>
The client decides wether whether to follow this redirect, . Browsers usually will, curl will not.  
=References=
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu