<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.getRequestProtocol.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.getRequestProtocol</api:function-name><api:suggest>xdmp.getrequestprotocol</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>getrequestprotocol</api:suggest><api:function-link mode="xquery" fullname="xdmp:get-request-protocol">/apidoc/8.0/xdmp:get-request-protocol.xml</api:function-link><api:function mode="javascript" name="getRequestProtocol" type="builtin" lib="xdmp" category="AppServerBuiltins" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.getRequestProtocol"><api:summary>
  Returns as a string the request protocol (either "http" or "https")

  <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 determine whether the client connection
  is HTTP or HTTPs.
</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 via https.</p>
  <pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
  if (xdmp.getRequestProtocol() == "https") {
  "Submitted via https."; }
  else {
  "Application requires secure connections only.";
  }
</pre></api:example><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.getRequestProtocol();
=&gt; "https"
</pre></api:example></api:function></api:function-page>