-<xqdoc:xqdoc>
-<xqdoc:module type="library">
<xqdoc:uri>http://exist-db.org/xquery/request</xqdoc:uri>
-<xqdoc:comment>
<xqdoc:description>Functions dealing with HTTP requests</xqdoc:description>
</xqdoc:comment>
</xqdoc:module>
-<xqdoc:functions>
-<xqdoc:function>
<xqdoc:name>create-session</xqdoc:name>
<xqdoc:signature>request:create-session() empty()</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Initialize an HTTP session if not already present</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>encode-url</xqdoc:name>
<xqdoc:signature>request:encode-url($a as xs:anyURI) xs:anyURI</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Encodes the specified URL with the current HTTP session-id.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>exists</xqdoc:name>
<xqdoc:signature>request:exists() xs:boolean</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns whether a request object exists.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-attribute</xqdoc:name>
<xqdoc:signature>request:get-attribute($a as xs:string) xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the string value of the request attribute specified in the argument or the empty sequence if no such attribute exists. The attribute value should be a string.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-context-path</xqdoc:name>
<xqdoc:signature>request:get-context-path() xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the context path of the current request, i.e. the portion of the request URI that indicates the context of the request.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-cookie-names</xqdoc:name>
<xqdoc:signature>request:get-cookie-names() xs:string*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the names of all Cookie's in the request</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-cookie-value</xqdoc:name>
<xqdoc:signature>request:get-cookie-value($a as xs:string) xs:string?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the value of the Cookie named in $a.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-data</xqdoc:name>
<xqdoc:signature>request:get-data() item()?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the content of a POST request.If its a binary document xs:base64Binary is returned or if its an XML document a node() is returned. All other data is returned as an xs:string representaion. Returns an empty sequence if there is no data.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-header</xqdoc:name>
<xqdoc:signature>request:get-header($a as xs:string) xs:string*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the HTTP request header identified by $a. The list of all headers included in the HTTP request are available through the request:get-header-names function.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-header-names</xqdoc:name>
<xqdoc:signature>request:get-header-names() xs:string*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns a sequence containing the names of all headers passed in the current request</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-hostname</xqdoc:name>
<xqdoc:signature>request:get-hostname() xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the hostname of the current request.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-method</xqdoc:name>
<xqdoc:signature>request:get-method() xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the HTTP method of the current request.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-parameter</xqdoc:name>
<xqdoc:signature>request:get-parameter($a as xs:string, $b as item()*) xs:string*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the HTTP request parameter identified by $a. If the parameter could not be found, the default value specified in $b is returned instead. Note: this function will not try to expand predefined entities like &amp; or &lt;, so a &amp; passed through a parameter will indeed be treated as an &amp; character.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-parameter</xqdoc:name>
<xqdoc:signature>request:get-parameter($a as xs:string, $b as item()*, $c as xs:boolean*) xs:string*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the HTTP request parameter identified by $a. If the parameter could not be found, the default value specified in $b is returned instead. Note: this function will not try to expand predefined entities like &amp; or &lt;, so a &amp; passed through a parameter will indeed be treated as an &amp; character. If the $c (failonerror) value is set to false, then the function will not fail if there is no request in scope.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-parameter-names</xqdoc:name>
<xqdoc:signature>request:get-parameter-names() xs:string*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns a sequence containing the names of all parameters passed in the current request</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-path-info</xqdoc:name>
<xqdoc:signature>request:get-path-info() xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the context path of the current request, i.e. the portion of the request URI that indicates the context of the request.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-query-string</xqdoc:name>
<xqdoc:signature>request:get-query-string() xs:string?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the full query string passed to the servlet (without the initial question mark).</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-request-data</xqdoc:name>
<xqdoc:signature>request:get-request-data() item()?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the content of a POST request. If its a binary document xs:base64Binary is returned or if its an XML document a node() is returned. All other data is returned as an xs:string representaion. Returns an empty sequence if there is no data.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-server-name</xqdoc:name>
<xqdoc:signature>request:get-server-name() xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the server nodename of the current request.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-server-port</xqdoc:name>
<xqdoc:signature>request:get-server-port() xs:integer</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the server port of the current request.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-session-attribute</xqdoc:name>
<xqdoc:signature>request:get-session-attribute($a as xs:string) xs:string*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns an attribute stored in the current session object or an empty sequence if the attribute cannot be found.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-session-id</xqdoc:name>
<xqdoc:signature>request:get-session-id() xs:string?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the ID of the current session or an empty sequence if there is no session.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-uploaded-file</xqdoc:name>
<xqdoc:signature>request:get-uploaded-file($a as xs:string) item()?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Retrieve the Java file object where the file part of a multi-part request has been stored. Returns the empty sequence if the request is not a multi-part request or the parameter name does not point to a file part.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-uploaded-file-name</xqdoc:name>
<xqdoc:signature>request:get-uploaded-file-name($a as xs:string) xs:string?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Retrieve the file name of an uploaded file from a multi-part request. This returns the file name of the file on the client (without path). Returns the empty sequence if the request is not a multi-part request or the parameter name does not point to a file part.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-uri</xqdoc:name>
<xqdoc:signature>request:get-uri() xs:anyURI</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the URI of the current request.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>get-url</xqdoc:name>
<xqdoc:signature>request:get-url() xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the URL of the current request.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>invalidate-session</xqdoc:name>
<xqdoc:signature>request:invalidate-session() empty()</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Invalidate (remove) the current HTTP session if present</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>parameter-names</xqdoc:name>
<xqdoc:signature>request:parameter-names() xs:string*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns a sequence containing the names of all parameters passed in the current request</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>redirect-to</xqdoc:name>
<xqdoc:signature>request:redirect-to($a as xs:anyURI) empty()</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Sends a HTTP redirect response (302) to the client. Note: this is not supported by the Cocooon generator. Use a sitemap redirect instead.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>request-hostname</xqdoc:name>
<xqdoc:signature>request:request-hostname() xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the hostname of the current request.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>request-parameter</xqdoc:name>
<xqdoc:signature>request:request-parameter($a as xs:string, $b as item()*) xs:string*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the HTTP request parameter identified by $a. If the parameter could not be found, the default value specified in $b is returned instead. Note: this function will not try to expand predefined entities like &amp; or &lt;, so a &amp; passed through a parameter will indeed be treated as an &amp; character.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>request-servername</xqdoc:name>
<xqdoc:signature>request:request-servername() xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the server nodename of the current request.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>request-serverport</xqdoc:name>
<xqdoc:signature>request:request-serverport() xs:integer</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the server port of the current request.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>request-uri</xqdoc:name>
<xqdoc:signature>request:request-uri() xs:anyURI</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns the URI of the current request.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>session-attributes</xqdoc:name>
<xqdoc:signature>request:session-attributes() xs:string*</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns a sequence containing the names of all session attributes defined within the current HTTP session.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>set-current-user</xqdoc:name>
<xqdoc:signature>request:set-current-user($a as xs:string, $b as xs:string) xs:boolean?</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Change the user identity for the current HTTP session. Subsequent XQueries in the session will run with the new user identity.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>set-session-attribute</xqdoc:name>
<xqdoc:signature>request:set-session-attribute($a as xs:string, $b as item()*) empty()</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Stores a value in the current session using the supplied attribute name.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>stream-binary</xqdoc:name>
<xqdoc:signature>request:stream-binary($a as xs:base64Binary?, $b as xs:string, ...) empty()</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Streams the binary data passed in $a to the current servlet response output stream. The ContentType HTTP header is set to the value given in $b. This function only works within a servlet context, not within Cocoon. Note: the servlet output stream will be closed afterwards and mime-type settings in the prolog will not be passed.</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
-<xqdoc:function>
<xqdoc:name>unescape-uri</xqdoc:name>
<xqdoc:signature>request:unescape-uri($a as xs:string, $b as xs:string) xs:string</xqdoc:signature>
-<xqdoc:comment>
<xqdoc:description>Returns an un-escaped URL escaped string identified by $a with the encoding scheme indicated by the string $b (e.g. "UTF-8"). Decodes encoded sensitive characters from a URL, for example "%2F" becomes "/", i.e. does the oposite to escape-uri()</xqdoc:description>
</xqdoc:comment>
</xqdoc:function>
</xqdoc:functions>
</xqdoc:xqdoc>