I'm trying to get the name value from an object. I tried everything but still dont get it. Any ideas?
Http http = new http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals/1');
request.setMethod('GET');
HttpResponse response = http.send(request);
if(response.getStatusCode() == 200) {
Map<String,Object> results = (Map<String,Object>)
JSON.deserializeUntyped(response.getBody());
Object animal = (Object) results.get('animal');
}
The value of the response: {eats=chicken food, id=1, name=chicken, says=cluck cluck}
I'm trying to get the name value.