• Sagar 12
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Hi,

I am new to integration and learning from trailhead.
I came accross this doubt in REST callout chapter

Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals');
request.setMethod('POST');
request.setHeader('Content-Type', 'application/json;charset=UTF-8');
// Set the body as a JSON object
request.setBody('{"name":"mighty moose"}');
HttpResponse response = http.send(request);
// Parse the JSON response
if (response.getStatusCode() != 201) {
    System.debug('The status code returned was not expected: ' +
        response.getStatusCode() + ' ' + response.getStatus());
} else {
    System.debug(response.getBody());
}

this code should append the "mighty moose" to my endpoint data.
but when i open endpoint in browser data remains same.

What is going on here? am I missing any point here.

Regards,
Sagar
I am a beginner in salesforce lightning and trying to create few components.
Can someone explain to me
1) what is the difference between 'id' and 'aura:id' attribute?
2) when to use component.get() and component.find() ?
 
I am a beginner in salesforce lightning and trying to create few components.
Can someone explain to me
1) what is the difference between 'id' and 'aura:id' attribute?
2) when to use component.get() and component.find() ?