
xdmp:get-request-protocol() as xs:string?
Returns as a string the request protocol (either "http" or "https")
Returns the empty sequence if it is not called from an HTTP server.
In an isolated evaluation context (see xdmp:is-isolated), this function is not available and throws XDMP-ISOLATED.
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."
xdmp:get-request-protocol() => "https"
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.