This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@isTest | |
private class TestDemoWebCallout { | |
static testMethod void testRestfulCallout() { | |
Lead l = new Lead(); | |
l.Status = 'Open'; | |
l.LastName = 'Owen'; | |
l.FirstName = 'Bob'; | |
l.Street = '1234 Sesame Street'; | |
l.City = 'Houston'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
====================================================================== | |
The following apex code demonstrates logging into another salesforce | |
org via the SOAP/XML web service api and then using session id to | |
query the standard REST API as well as the Chatter REST API. | |
To run this code, simply copy and paste into execute anonymous, | |
then replace the value of the first three variables accordingly. | |
NOTES: | |
(1) You'll need to create a remote site setting for both the login |