Error:
Option 2:
End point address should be https.
[{"message":"HTTPS Required","errorCode":"UNSUPPORTED_CLIENT"}]
Solution:
Unsupported_Client error occurs when making callout from salesforce using http web server instead of https. There are two possible solutions to fix this issue,
Option 1:
You can change the security setting in your Salesforce account to allow API communication over HTTP as follows:
1. Log into Salesforce.com.
2. Click Setup, click Security Controls, and then click Session Settings.
3. Uncheck the option labeled Require secure connections (HTTPS).
Note: To change to HTTP, you need to contact salesforce.com
- HttpRequest req = new HttpRequest();
- req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID());
- req.setHeader('Content-Type', 'application/json');
- req.setEndpoint('https://na15.salesforce.com/services/data/v36.0/tooling/sobjects/');
- req.setMethod('GET');
End point address should be https.
No comments:
Post a Comment