You need to sign in to do that
Don't have an account?
sreeja
Rest callouts trialhead challenge logerror
hi i had performed the rest callouts, by authorizing the endpoint url into the remotesite settings and later in the anonymous window i had copied and pasted the code form the trailhead..
the request was sucessfull, and got the response..
the issue was after the selection of the debuglog checkbox the data is not displayed here;
the code is
the request was sucessfull, and got the response..
the issue was after the selection of the debuglog checkbox the data is not displayed here;
the code is
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); } }the screnshots are shown below
Thanks
hi meghana thanks for your reply, i had make callout like this . and i had got the same empty data in the request
i had tried in the other org, iam getting the response there with the same code, should i have to do any settings in this
thanks
sree..
Did you set the remote site settings with url like:-
https://th-apex-http-callout.herokuapp.com
Thanks
yes i had set the remotesite settings with url ,as i mentioned above, so i am trying to figure out , why it was showing empty , as i had enabled the development mode as well in the advanced user settings ,i had figured out a another problem that
debuglog is not showing the results for any request.
ex: In anonymous window i had executed this code:
system.debug('testing');
system.debug('testing2');
system.debug('testing3');
it is getting executing , but in response it was showing the empty, iam thinking to figure out the exact solution ... as i was new to salesforce , other imptant query was, header of this is different as when compared to another org,as i had shown below
the license i had assinged is salesforce license and profile as the systemadministrator, the header of this org is different when compared to other header.
thanks
vani
https://www.google.com/search?q=how+does+professional+edition+in+salesforce+looks+like&rlz=1C1GCEU_enIN829IN829&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiN74aWxKvgAhUWY48KHatQDKgQ_AUIDygC&biw=1280&bih=610#imgrc=RyhObxyUkZ-FTM:
This is how it looks like right.
Thanks
thanks and regards
vani