<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.getRequestClientAddress.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.getRequestClientAddress</api:function-name><api:suggest>xdmp.getrequestclientaddress</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>getrequestclientaddress</api:suggest><api:function-link mode="xquery" fullname="xdmp:get-request-client-address">/apidoc/8.0/xdmp:get-request-client-address.xml</api:function-link><api:function mode="javascript" name="getRequestClientAddress" type="builtin" lib="xdmp" category="AppServerBuiltins" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.getRequestClientAddress"><api:summary>
  Returns as a string the internet address of the
  client from which the HTTP server request is issued.

  <p xmlns="http://www.w3.org/1999/xhtml">Returns the empty sequence if it is not called from an HTTP server.</p>
</api:summary><api:params/><api:return>String?</api:return><api:usage>
  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).
</api:usage><api:example class="javascript">
  <p xmlns="http://www.w3.org/1999/xhtml">The following example shows logic which checks if the request was
  submitted from the "localhost" IP address (127.0.0.1).</p>
  <pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  if (xdmp.getRequestClientAddress() == "127.0.0.1") {
  "Submitted from localhost."; }
  else {
  "Only localhost access is allowed for this application.";
  }
</pre></api:example><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.getRequestClientAddress();
=&gt; "127.0.0.1"
</pre></api:example></api:function></api:function-page>