Request Module

From BaseX Documentation
Revision as of 21:00, 9 July 2012 by CG (talk | contribs) (Created page with "This XQuery Module contains functions for processing servlet request data with the RESTXQ API. =Conventions= All functions in this module are assigned to...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This XQuery Module contains functions for processing servlet request data with the RESTXQ API.

Conventions

All functions in this module are assigned to the http://exquery.org/ns/restxq/Request namespace, which must be dynamically imported. In this documentation, the request prefix is used.
Next, the first argument of all functions must be a servlet request container, which can be bound via the %restxq:request(...) annotation. An example:

module namespace test = 'http://basex.org/examples/test';

import module namespace request = "http://exquery.org/ns/restxq/Request";

declare
  %restxq:GET
  %restxq:path("...")
  %restxq:request("{$request}")
  function test:function($request)
{
  ...
};
...

Functions

request:session-id

Signatures request:session-id($request as basex:request) as xs:string
Summary Returns the session ID of a servlet request.

request:get-attribute

Signatures request:get-attribute($request as basex:request, $key as xs:string) as xs:string?
Summary Returns the value of an attribute bound to the current session, or an empty sequence if no value was bound.

request:set-attribute

Signatures request:set-attribute($request as basex:request, $key as xs:string, $value as xs:string) as empty-sequence()
Summary Binds an attribute with the specified value to the current session.

Changelog

This module was introduced with Version 7.3.1.