Get the Protocol from base url in salesforce

 Some times, we need to fetch the protocol of the our call. It should be http or https. here is the method for fetch protocol of salesforce.

Answers

System.debug('Protocol: ' + URL.getSalesforceBaseUrl().getProtocol());
Labels:
Join the conversation