Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Map<String, String> listGroups() {
- HTTPRequest req = new HttpRequest();
- req.setMethod('GET');
- req.setHeader('Accept', 'application/json');
- req.setEndpoint('callout:PrimaryEndpoint/');
- HTTPResponse res = new Http().send(req);
- ....
- }
- public static Map<String, String> listUsers() {
- HTTPRequest req = new HttpRequest();
- req.setMethod('GET');
- req.setHeader('Accept', 'application/json');
- req.setEndpoint('callout:PrimaryEndpoint/users');
- HTTPResponse res = new Http().send(req);
- ....
- }
- public static Map<String, String> listFiles() {
- HTTPRequest req = new HttpRequest();
- req.setMethod('GET');
- req.setHeader('Accept', 'application/json');
- req.setEndpoint('callout:PrimaryEndpoint/files');
- HTTPResponse res = new Http().send(req);
- ....
- }
- public static HttpResponse doCallout(String urlPath) {
- HttpRequest req = new HttpRequest();
- req.setMethod('GET');
- req.setHeader('Accept', 'application/json');
- req.setEndpoint('callout:PrimaryEndpoint/' + urlPath);
- HttpResponse res = new Http().send(req);
- //do some error checking here
- return res;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement