function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Charlene Johnson 1Charlene Johnson 1 

What is a HTTP Callout?

Amit Singh 1Amit Singh 1
https://www.citrix.com/blogs/2008/12/06/http-callout/
Amit Chaudhary 8Amit Chaudhary 8
Hi Charlene Johnson 1,

If you want to learn about HTTP Callout in salesforce i will recomment you to check below trailhead module
1) Apex Integration Services (https://trailhead.salesforce.com/modules/apex_integration_services)

Sample code for HTTP callout
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals');
request.setMethod('GET');
HttpResponse response = http.send(request);
// If the request is successful, parse the JSON response.
if (response.getStatusCode() == 200) {
    // Deserialize the JSON string into collections of primitive data types.
    Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
    // Cast the values in the 'animals' key as a list
    List<Object> animals = (List<Object>) results.get('animals');
    System.debug('Received the following animals:');
    for (Object animal: animals) {
        System.debug(animal);
    }
}

Please check below post as well i hope that will help you
1) http://amitsalesforce.blogspot.com/2017/01/learn-rest-api-in-salesforce-how-to.html

Let us know if this will help you
 
Charlene Johnson 1Charlene Johnson 1
Many thanks for all of your responses.