|
|
xdmp:get-request-body( ) as xs:string?
|
|
 |
Summary:
Returns the POST body of this request, if it is not
application/x-www-form-urlencoded.
Returns the empty sequence if it is not called from an application
server.
|
Usage Notes:
If the content-type of the POST body is application/x-www-form-urlencoded,
it is not available here, but instead is available in its decoded form
through xdmp:get-request-field-names() and
xdmp:get-request-field().
If there is no content-type header in the request, then the request
body defaults to application/x-www-form-urlencoded, and therefore
xdmp:get-request-body will return the empty sequence. If
you want to read the request body, then the POST must include a
content-type header.
You can use this function to process certain types of web service
SOAP requests with MarkLogic Server.
|
Example:
|
|
|
|
xdmp:get-request-client-address( ) as xs:string?
|
|
 |
Summary:
Returns as a string the internet address of the
client from which the HTTP server request is issued.
Returns the empty sequence if it is not called from an HTTP server.
|
Usage Notes:
Use this function if you need to get the internet protocol (IP) address of
the requesting client. For example, you can create an application that
contains conditional code based on IP addresses (see the example below).
|
Example:
The following example shows logic which checks if the request was
submitted from the "localhost" IP address (127.0.0.1).
if (xdmp:get-request-client-address() eq "127.0.0.1")
then "Submitted from localhost."
else "Only localhost access is allowed for this application."
|
Example:
xdmp:get-request-client-address()
=> "127.0.0.1"
|
|
|