Created
October 2, 2019 09:48
-
-
Save olopsman/efe027eb5109945fdc6c55eb49715c2a to your computer and use it in GitHub Desktop.
Apex Sample REST Callout
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
public class dataTableSampleREST { | |
@AuraEnabled | |
public static String getDocumentList() { | |
String strEndPoint = 'https://www.lopau.com/rest/accounts'; | |
HttpRequest req = new HttpRequest(); | |
req.setMethod('GET'); | |
req.setEndpoint(strEndPoint); | |
Http h = new Http(); | |
system.debug('## => ' + req); | |
HTTPResponse res = h.send(req); | |
System.debug('## => ' + res.getBody()); | |
if (res.getStatusCode() == 200) { | |
system.debug('## res.getBody() =>' + res.getBody()); | |
return res.getBody(); | |
} | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment