Valid PDII Dumps shared by ExamDiscuss.com for Helping Passing PDII Exam! ExamDiscuss.com now offer the newest PDII exam dumps, the ExamDiscuss.com PDII exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com PDII dumps with Test Engine here:
When the code is executed, the callout is unsuccessful and the following error appears within the Developer Console: System.CalloutException: Unauthorized endpoint Which recommended approach should the developer implement to resolve the callout exception?
Correct Answer: D
The System.CalloutException with the message "Unauthorized endpoint" typically indicates that the endpoint to which the callout is being made has not been authorized in the Salesforce org's security settings. To resolve this, the developer must navigate to the Remote Site Settings in the Salesforce Setup and add the endpoint URL as a new remote site. This step is necessary to authorize the Salesforce org to send outbound callouts to that specific endpoint. Annotating with @Future(Callout=true) is necessary for making callouts from methods that perform DML operations, but it does not resolve endpoint authorization issues. Similarly, changing the access modifier or using SetHeader() for authentication would not address the unauthorized endpoint error. References: Remote Site Settings Apex Developer Guide: Making Callouts Using Apex