Suggested answer

Apex callouts send HTTP requests to external systems. Steps:

1. Add the endpoint to Remote Site Settings or use a Named Credential (recommended for authentication).
2. Use HttpRequest, HttpResponse, and Http classes.
3. Callouts cannot be made after DML in the same transaction — use @future(callout=true) or Queueable/Batch to separate them.
4. In test classes, use HttpCalloutMock interface and Test.setMock() to mock HTTP responses.
5. Maximum callout timeout is 120 seconds; 100 callouts per transaction. Named Credentials handle authentication (Basic, OAuth, JWT) declaratively, preventing credentials from being hardcoded in Apex. Always handle HTTP status codes and exceptions (callout timeout, network errors).

Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.

Community comments (0)

No comments yet.

Sign in or create a free account to add a comment. Comments are moderated before they appear.

Plain text only, 3–2000 characters. A moderator reviews every comment before it is published.