Changes

Jump to navigation Jump to search
702 bytes added ,  14:20, 20 July 2022
no edit summary
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:method||xs:string}}
|-valign="top"
| '''Summary'''
|Returns the Method of the HTTP request.
==request:scheme==
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:scheme||xs:string}}
|-valign="top"
| '''Summary'''
|Returns the Scheme component of the URI of an HTTP request.
|-valign="top"
| '''Example'''
|For the example given in the introduction, this function would return {{Code|foo}}.
==request:hostname==
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:hostname||xs:string}}
|-valign="top"
| '''Summary'''
|Returns the Hostname component of the URI of an HTTP request.
|-valign="top"
| '''Example'''
|For the example given in the introduction, this function would return {{Code|example.com}}.
==request:port==
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:port||xs:integer}}
|-valign="top"
| '''Summary'''
|Returns the Port component of the URI of an HTTP request, or a default port if it has not been explicitly specified in the URI.
|-valign="top"
| '''Example'''
|For the example given in the introduction, this function would return {{Code|8042}}.
==request:path==
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:path||xs:string}}
|-valign="top"
| '''Summary'''
|Returns the Path component of the URI of an HTTP request.
|-valign="top"
| '''Example'''
|For the example given in the introduction, this function would return {{Code|/over/there}}.<br/>
==request:query==
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:query||xs:string?}}
|-valign="top"
| '''Summary'''
|Returns the Query component of the URI of an HTTP request. If no query component exists, an empty sequence is returned.
|-valign="top"
| '''Example'''
|For the example given in the introduction, this function would return <code>name=ferret</code>.<br/>
==request:uri==
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:uri||xs:anyURI}}
|-valign="top"
| '''Summary'''
|Returns the complete URI of an HTTP request as it has been specified by the client.
|-valign="top"
| '''Example'''
|For the example given in the introduction, this method would return <code>foo://example.com:8042/over/there?name=ferret</code>.<br/>
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:context-path||xs:string}}
|-valign="top"
| '''Summary'''
|Returns the context of the request. For servlets in the default (root) context, this method returns an empty string.
==request:address==
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:address||xs:string}}
|-valign="top"
| '''Summary'''
|Returns the IP address of the server.
==request:remote-hostname==
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:remote-hostname||xs:string}}
|-valign="top"
| '''Summary'''
|Returns the fully qualified hostname of the client that sent the request.
==request:remote-address==
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:remote-address||xs:string}}
|-valign="top"
| '''Summary'''
|Returns the IP address of the client that sent the request.
==request:remote-port==
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:remote-port||xs:string}}
|-valign="top"
| '''Summary'''
|Returns the TCP port of the client socket that triggered the request.
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:parameter-names||xs:string*}}
|-valign="top"
| '''Summary'''
|Returns the names of all query and form field parameters available from the HTTP request. With [[RESTXQ]], this function can be used to access parameters that have not been statically bound by [[RESTXQ#Query Parameters|%rest:query-param]].
|-valign="top"
| '''Example'''
|For the example given in the introduction, this function would return {{Code|name}}.<br/>
|-valign="top"
| '''Errors'''
|{{Error|parameter|#Errors}} the request has invalid parameters.
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:parameter|$name as xs:string|xs:string*}}<br/>{{Func|request:parameter|$name as xs:string, $default as xs:string|xs:string*}}
|-valign="top"
| '''Summary'''
|Returns the value of the named query or form field parameter in an HTTP request. If the parameter does not exist, an empty sequence or the optionally specified default value is returned instead. If both query and form field parameters with the same name exist, the form field values will be attached to the query values.
|-valign="top"
| '''Example'''
|For the example given in the introduction, the function call {{Code|request:parameter('name')}} would return {{Code|ferret}}.<br/>
|-valign="top"
| '''Errors'''
|{{Error|parameter|#Errors}} the request has invalid parameters.
==request:header-names==
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:header-names||xs:string*}}
|-valign="top"
| '''Summary'''
|Returns the names of all headers available from the HTTP request. If [[RESTXQ]] is used, this function can be used to access headers that have not been statically bound by [[RESTXQ#HTTP Headers|%rest:header-param]].
==request:header==
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:header|$name as xs:string|xs:string?}}<br/>{{Func|request:header|$name as xs:string, $default as xs:string|xs:string}}
|-valign="top"
| '''Summary'''
|Returns the value of the named header in an HTTP request. If the header does not exist, an empty sequence or the optionally specified default value is returned instead.
==request:cookie-names==
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:cookie-names||xs:string*}}
|-valign="top"
| '''Summary'''
|Returns the names of all cookies in the HTTP headers available from the HTTP request. If [[RESTXQ]] is used, this function can be used to access cookies that have not been statically bound by [[RESTXQ#Cookies|%rest:cookie-param]].
==request:cookie==
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:cookie|$name as xs:string|xs:string?}}<br/>{{Func|request:cookie|$name as xs:string, $default as xs:string|xs:string}}
|-valign="top"
| '''Summary'''
|Returns the value of the named Cookie in an HTTP request. If there is no such cookie, an empty sequence or the optionally specified default value is returned instead.
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:attribute-names||xs:string*}}
|-valign="top"
| '''Summary'''
|Returns the names of all HTTP request attributes.
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:attribute|$name as xs:string|item()*}}<br/>{{Func|request:attribute|$name as xs:string, $default as item()*|item()*}}
|-valign="top"
| '''Summary'''
|Returns the value of an attribute of the HTTP request. If the attribute does not exist, an empty sequence or the optionally specified default value is returned instead.
|-valign="top"
| '''Example'''
|
{| width='100%'
|-valign="top"
| width='120' | '''Signatures'''
|{{Func|request:set-attribute|$name as xs:string, $value as item()*|empty-sequence()}}
|-valign="top"
| '''Summary'''
|Binds the specified {{Code|$value}} to the request attribute with the specified {{Code|$name}}.
! width="110"|Code
|Description
|-valign="top"
|{{Code|parameter}}
|Request has invalid parameters.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu