-
Notifications
You must be signed in to change notification settings - Fork 14
RestClientLib
STATUS: ACTIVE
This class is a wrapper around the RestLib class that is intended to be extended by developers
to provide a quick, safe, and reliable way of making REST callouts. By extending this class you're locking your
class to a specific Named Credential, which is a best practice for making callouts, and you're inheriting methods
like get, post, put, patch, and del that make it easy to make callouts without having to worry about
setting headers, or other common tasks.
Inheritance
RestLib > RestClient > RestClientLib
default constructor requiring a named credential string
| Param | Description |
|---|---|
namedCredentialName |
String named credential name |
Inherited
TESTVISIBLE
The name of the Named Credential to use
TESTVISIBLE
SUPPRESSWARNINGS
Makes an HTTP Callout to an api resource. Convenience method that assumes the Default Headers.
| Param | Description |
|---|---|
method |
HTTPVerb to use. See the enum above. |
path |
Http path component of the URL. ie: /path/to/resource
|
query |
Query component of the URL ie: after ?foo=bar
|
body |
Body to send with this call. |
| Type | Description |
|---|---|
| HttpResponse | HttpResponse |
TESTVISIBLE
convenience version of makeApiCall without body param. Invokes omnibus version above, with blank body param and default headers.
| Param | Description |
|---|---|
method |
HTTPVerb to use. See the enum above. |
path |
Http path component of the URL. ie: /path/to/resource
|
query |
Query component of the URL ie: after ?foo=bar
|
| Type | Description |
|---|---|
| HttpResponse | HTTPResponse |
TESTVISIBLE
convenience version of makeApiCall without body or query params. Invokes omnibus version above, with blank body and query params
| Param | Description |
|---|---|
method |
HTTPVerb to use. See the enum above. |
path |
Http path component of the URL. ie: /path/to/resource
|
| Type | Description |
|---|---|
| HttpResponse | HTTPResponse |
TESTVISIBLE
convenience method for a GET Call that only requires a path
| Param | Description |
|---|---|
path |
Http path component of the URL. ie: /path/to/resource
|
| Type | Description |
|---|---|
| HttpResponse | HTTPResponse |
TESTVISIBLE
convenience method for a GET Call that only requires a path and query
| Param | Description |
|---|---|
path |
Http path component of the URL. ie: /path/to/resource
|
query |
Query component of the URL ie: after ?foo=bar
|
| Type | Description |
|---|---|
| HttpResponse | HTTPResponse |
TESTVISIBLE
convenience method for deleting a resource based only on path
| Param | Description |
|---|---|
path |
Http path component of the URL. ie: /path/to/resource
|
| Type | Description |
|---|---|
| HttpResponse | HTTPResponse |
TESTVISIBLE
convenience method for a Delete Call that only requires a path and query
| Param | Description |
|---|---|
path |
Http path component of the URL. ie: /path/to/resource
|
query |
Query component of the URL ie: after ?foo=bar
|
| Type | Description |
|---|---|
| HttpResponse | HTTPResponse |
TESTVISIBLE
convenience method for a POST Call that only requires a path and body
| Param | Description |
|---|---|
path |
Http path component of the URL. ie: /path/to/resource
|
body |
JSON string to post |
| Type | Description |
|---|---|
| HttpResponse | HTTPResponse |
TESTVISIBLE
convenience method for a POST Call that only requires a path, query and body
| Param | Description |
|---|---|
path |
Http path component of the URL. ie: /path/to/resource
|
query |
Query component of the URL ie: after ?foo=bar
|
body |
JSON string to post |
| Type | Description |
|---|---|
| HttpResponse | HTTPResponse |
TESTVISIBLE
convenience method for a PUT Call that only requires a path and body
| Param | Description |
|---|---|
path |
Http path component of the URL. ie: /path/to/resource
|
body |
JSON string to post |
| Type | Description |
|---|---|
| HttpResponse | HTTPResponse |
TESTVISIBLE
convenience method for a PUT Call that only requires a path, query and body
| Param | Description |
|---|---|
path |
Http path component of the URL. ie: /path/to/resource
|
query |
Query component of the URL ie: after ?foo=bar
|
body |
JSON string to post |
| Type | Description |
|---|---|
| HttpResponse | HTTPResponse |
TESTVISIBLE
convenience method for a PATCH Call that only requires a path and body
| Param | Description |
|---|---|
path |
Http path component of the URL. ie: /path/to/resource
|
body |
JSON string to post |
| Type | Description |
|---|---|
| HttpResponse | HTTPResponse |
TESTVISIBLE
convenience method for a PATCH Call that only requires a path, query and body
| Param | Description |
|---|---|
path |
Http path component of the URL. ie: /path/to/resource
|
query |
Query component of the URL ie: after ?foo=bar
|
body |
JSON string to post |
| Type | Description |
|---|---|
| HttpResponse | HTTPResponse |