An Apex
callout enables you to tightly integrate your Apex with an external service by
making a call to an external Web service or sending a HTTP request from Apex code and then receiving the
response.
Apex provides integration with
Web services that utilize SOAP and WSDL, or HTTP services (RESTful services).
-
Before any Apex callout can call an
external site, that site must be registered in the Remote Site Settings page, or the callout
fails.
Salesforce prevents calls to
unauthorized network addresses.
-
If you use setEndpoint(endpoint) to
specify a named credential as the endpoint, you don’t need to configure remote
site settings.
A named credential specifies the URL of a callout
endpoint and its required authentication parameters in one definition.
To set up named credentials, see “Define a Named Credential” in the Salesforce
Help.
To learn more about the types of callouts, see:
Callouts enable Apex to invoke external web or HTTP services. Apex Web services allow an external application to invoke Apex methods through Web services.