A simple class which makes using REST services like the GitHub API really easy. This utilizes helpful features of Groovy while not relying on any heavier external libraries for HTTP communication.
apiFetch() can be used to submit HTTP commands common to REST APIs. If http_headers does not contain a Content-Type header, then application/json is assumed.
api_url
- A URL of a REST endpoint in which to make an HTTP call.http_headers
- HTTP headers to pass as part of the HTTP request. By
default only Content-Type: application/json
HTTP header will be set.http_method
- The HTTP method or action to request from the server.
Currently supported methods include: GET, POST, PUT,
DELETE, and PATCH.