Changes

Jump to navigation Jump to search
229 bytes removed ,  23:38, 8 September 2012
no edit summary
| '''Summary'''
|Returns the Path component of the URI of an HTTP request.
| '''Examples'''
|The following RESTXQ function can e.g. be called via <code><nowiki>http://localhost:8984/restxq/hey/john</nowiki></code>:
<pre class="brush:xquery">
module namespace test = 'http://basex.org/examples/test';
import module namespace request = "http://exquery.org/ns/restxq/request";
declare %restxq:path("/path-check") function test:get($req, $name) {
'Path of this page: ' || request:path()
};
</pre>
|}
request:set-attribute($req, $key, $value),
'Attribute was set.'
};
</pre>
|}
 
==request:path==
 
{|
|-
| width='90' | '''Signatures'''
|{{Func|request:path||xs:string}}
|-
| '''Summary'''
|Returns the path relative to the RESTXQ URI.
|-
| '''Examples'''
|The following RESTXQ function can e.g. be called via <code><nowiki>http://localhost:8984/restxq/hey/john</nowiki></code>:
<pre class="brush:xquery">
module namespace test = 'http://basex.org/examples/test';
import module namespace request = "http://exquery.org/ns/restxq/request";
declare
%restxq:path("/hey/{$name}")
%restxq:request("{$req}")
function test:get($req, $name)
{
'Hey ' || $name || '! Relative path of this page: ' || request:path($req)
};
</pre>
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu