Changes

Jump to navigation Jump to search
1,140 bytes added ,  19:57, 11 November 2019
| '''Errors'''
|{{Error|invalid|#Errors}} the string contains invalid XML characters.
|}
 
==web:forward==
 
{{Mark|Introduced with Version 9.3:}}
 
{| width='100%'
|-
| width='120' | '''Signatures'''
|{{Func|web:forward|$path as xs:string|element(rest:forward)}}<br/>{{Func|web:forward|$path as xs:string, $parameters as map(*)|element(rest:forward)}}
|-
| '''Summary'''
|Creates a server-side [[RESTXQ#Forwards and Redirects|RESTXQ forward request]] to the specified {{Code|$path}}. The client will not get notified of this forwarding.<br/>The {{Code|$parameter}} argument is processed as described in [[#web:create-url|web:create-url]].
|-
| '''Examples'''
|
* The function call <code><nowiki>web:forward('/a/b')</nowiki></code> returns the following result (which will be interpreted as forwarding if RESTXQ is used):
<pre class="brush:xml">
<rest:forward>/a/b</rest:forward>
* The first RESTXQ function creates an initial database, and forwards to a second function:
<pre class="brush:xquery">
declare %updating %rest:path('/app/create') function local:create() {
db:create('database'),
db:output(web:forward('/app/ok'))
};
 
declare %rest:path('/app/ok') function local:ok() {
'The operation was successful'
};
</pre>
|}
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu