mirror of
https://github.com/forcedotcom/afv-library.git
synced 2026-08-06 15:59:59 +08:00
21 lines
481 B
OpenEdge ABL
21 lines
481 B
OpenEdge ABL
|
|
public with sharing class RestClient {
|
||
|
|
public enum HttpVerb {
|
||
|
|
GET,
|
||
|
|
POST,
|
||
|
|
PUT,
|
||
|
|
PATCH,
|
||
|
|
DEL
|
||
|
|
}
|
||
|
|
|
||
|
|
public static HttpResponse makeApiCall(
|
||
|
|
String namedCredential,
|
||
|
|
HttpVerb method,
|
||
|
|
String path
|
||
|
|
) {
|
||
|
|
HttpRequest request = new HttpRequest();
|
||
|
|
request.setEndpoint('callout:' + namedCredential + '/' + path);
|
||
|
|
request.setMethod(method.name());
|
||
|
|
return new Http().send(request);
|
||
|
|
}
|
||
|
|
}
|