-
Notifications
You must be signed in to change notification settings - Fork 13
RestLibApiCall
STATUS: ACTIVE
This class encapsulates the information needed to make a callout except the endpoint which is specified by named credential in other RestLib classes.
TESTVISIBLE
public RestLibApiCall(HttpVerb method, String path, String query, String body, Map<String,String> headers)
SUPPRESSWARNINGS
Basic constructor that builds an instance with the necessary information to make a callout.
Param | Description |
---|---|
method |
HttpVerb enum value ie: GET, POST, PUT, PATCH, DEL |
path |
String of the path to the resource |
query |
String of the query parameters to be appended to the path |
body |
String of the body to be sent with the request |
headers |
Map<String, String> of the headers to be sent with the request |
SUPPRESSWARNINGS
Basic constructor that builds an instance with the necessary information to make a callout.
Param | Description |
---|---|
method |
HttpVerb enum value ie: GET, POST, PUT, PATCH, DEL |
path |
String of the path to the resource |
query |
String of the query parameters to be appended to the path |
body |
String of the body to be sent with the request |
The default headers to use, when none are specified
body the string encoded body to be included in the request
stores the encoded URL parameters
Property returning true if there is a body and the method is POST or PUT
stores the httpverb defined in the enum
Stores the path to the resource
The query string to be appended to the path
TESTVISIBLE
Ensures that the inputted string ends in a /
makes callouts more robust.
Param | Description |
---|---|
resource |
string to ensure ends in /
|
Type | Description |
---|---|
String | inputted string with / if it didn't already end in one. |