request:is-multipart-content
request:is-multipart-content() as xs:boolean
Determine if the request contains multipart/form-data
- Returns:
- xs:boolean : true is the request is a multipart/form-data request else false.
A module for dealing with HTTP requests.
request:attribute-names() as xs:string*
Returns the names of all request attributes in the current request.
request:exists() as xs:boolean
Returns whether a request object exists.
request:get-attribute($attribute-name as xs:string) as item()*
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.
$attribute-name | The name of the attribute |
request:get-context-path() as xs:string
Returns the context path of the current request, i.e. the portion of the request URI that indicates the context of the request.
request:get-cookie-names() as xs:string*
Returns the names of all Cookies in the request
request:get-cookie-value($cookie-name as xs:string) as xs:string?
Returns the value of a named Cookie.
$cookie-name | The name of the cookie to retrieve the value from. |
request:get-data() as item()?
Returns the content of a POST request. If the HTTP Content-Type header in the request identifies it as a binary document, then xs:base64Binary is returned. If its not a binary document, we attempt to parse it as XML and return a document-node(). If its not a binary or XML document, any other data type is returned as an xs:string representation or an empty sequence if there is no data to be read.
request:get-effective-uri() as xs:anyURI
Returns the URI of the current request. If the request was forwarded via URL rewriting, the function returns the effective, rewritten URI, not the original URI which was received from the client.
request:get-header($header-name as xs:string) as xs:string?
Returns the HTTP request header identified by $header-name. The list of all headers included in the HTTP request are available through the request:get-header-names function.
$header-name | The HTTP request header name |
request:get-header-names() as xs:string*
Returns a sequence containing the names of all headers passed in the current request
request:get-hostname() as xs:string
Returns the hostname of the current request.
request:get-method() as xs:string
Returns the HTTP method of the current request.
request:get-parameter($name as xs:string, $default-value as item()*) as xs:string*
Returns the HTTP request parameter identified by $name. If the parameter could not be found, the default value is returned instead. Note: this function will not try to expand predefined entities like & or <, so a & passed through a parameter will indeed be treated as an & character.
$name | The parameter name |
$default-value* | The default value if the parameter does not exist |
request:get-parameter($name as xs:string, $default-value as item()*, $failonerror as xs:boolean*) as xs:string*
Returns the HTTP request parameter identified by $name. If the parameter could not be found, the default value is returned instead. Note: this function will not try to expand predefined entities like & or <, so a & passed through a parameter will indeed be treated as an & character.
$name | The parameter name |
$default-value* | The default value if the parameter does not exist |
$failonerror* | The fail on error flag. If the value is set to false, then the function will not fail if there is no request in scope. |
request:get-parameter-names() as xs:string*
Returns a sequence containing the names of all parameters passed in the current request
request:get-path-info() as xs:string
Returns any extra path information associated with the URL the client sent when it made this request. For example an xquery GET or POST to /some/path/myfile.xq/extra/path will return /extra/path when myfile.xq is executed.
request:get-query-string() as xs:string?
Returns the full query string passed to the servlet (without the initial question mark).
request:get-remote-addr() as xs:string
Returns the IP address of the client machine that made the current request, as a string.
request:get-remote-host() as xs:string
Returns the fully qualified name of the client or the last proxy that sent the current request.
request:get-remote-port() as xs:integer
Returns the Internet Protocol (IP) source port of the client or last proxy that sent the current request.
request:get-scheme() as xs:string
Returns the name of the scheme used in the current request, for example, http, https, or ftp.
request:get-server-name() as xs:string
Returns the server nodename of the current request.
request:get-server-port() as xs:integer
Returns the server port of the current request.
request:get-servlet-path() as xs:string
Returns the servlet path of the current request, i.e. the portion of the request URI that points to the servlet which is handling the request. For example an xquery GET or POST to /some/path/myfile.xq/extra/path will return /some/path/myfile.xq when myfile.xq is executed.
request:get-uploaded-file-data($upload-param-name as xs:string) as xs:base64Binary*
Retrieve the base64 encoded data 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.
$upload-param-name | The parameter name |
request:get-uploaded-file-name($upload-param-name as xs:string) as xs:string*
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.
$upload-param-name | The parameter name |
request:get-uploaded-file-size($upload-param-name as xs:string) as xs:double*
Retrieve the size of an uploaded file from a multi-part request. This returns the size of the file in bytes. Returns the empty sequence if the request is not a multi-part request or the parameter name does not point to a file part.
$upload-param-name | The parameter name |
request:get-uri() as xs:anyURI
Returns the URI of the current request. This will be the original URI as received from the client. Possible modifications done by the URL rewriter will not be visible.
request:get-url() as xs:string
Returns the URL of the current request.
request:is-multipart-content() as xs:boolean
Determine if the request contains multipart/form-data
request:set-attribute($name as xs:string, $value as item()*) as item()
Stores a value in the current request using the supplied attribute name.
$name | The attribute name |
$value* | The attribute value |