Loading TOC...

xdmp:get-request-protocol

xdmp:get-request-protocol() as xs:string?

Summary

Returns as a string the request protocol (either "http" or "https")

Returns the empty sequence if it is not called from an HTTP server.

Usage Notes

Use this function if you need to determine whether the client connection is HTTP or HTTPs.

Example

The following example shows logic which checks if the request was submitted via https.

  if (xdmp:get-request-protocol() eq "https")
  then "Submitted via https."
  else "Application requires secure connections only."

Example

xdmp:get-request-protocol()
=> "https"

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.