};</pre>
If the URI http://localhost:8984/hello/world is accessed, the result will be kind ofsimilar to:
<pre class="brush:xml">
<response>> <title>>Hello worldWorld!</title>> <info>You requested this page with Mozilla/5.0 (Windows; Utime> Windows NT 5The current time is: 18:42:02.1306+02:00< en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13.time<gt;/info></response>>
</pre>
We added The RESTXQ module contains yet another method within that modulefunction:
<pre class="brush:xquery">
declare %rest:path("/form/") %rest:POST %rest:form-param("contentmessage","{$message}", "'(no message delivered')") %rest:header-param("User-Agent", "{$agent}") function page:hello-postman( $message as xs:string, $agent as xs:string*) as element(response) { <response>type='form'> <title>Hello!message>{ $message }</title>message> <info>It seems you posted a message: user-agent>{ $message agent }</info>user-agent> </response>>
};
</pre>
If you posted post something (e.g. using curl or the embedded form at http://localhost:8984/ )...
<pre class="brush:shell">
curl -i -X POST --data "content='Here comes the postCONTENT'" http://admin:admin@localhost:8984/form
</pre>
You would recieve...you will receive something similar to the following result:
<pre class="brush:xml">
<response>type="form"> <title>Hello!message>CONTENT</title>message> <info>It seems you posted a message: 'Here comes the post'user-agent>Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/28.0.1500.72 Safari/537.36</info>user-agent></response>>
</pre>