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.
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"