
xdmp.getRequestProtocol() as 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.isIsolated), 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.getRequestProtocol() == "https") {
"Submitted via https."; }
else {
"Application requires secure connections only.";
}
xdmp.getRequestProtocol(); => "https"
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.