export interface GetOptions { url: string; headers?: Record; } export interface PostOptions { url: string; body: Record; headers?: Record; } export default class Request { /** * Make a GET request * @param url The URL to make the GET call to * @param headers Additional headers to set for the call * @return The raw response object * @throws If the HTTP response code is non 2xx */ static get({ url, headers }: GetOptions): Promise; /** * Make a POST request * @param url The URL to make the POST call to * @param body The JSON body to send * @param headers Additional headers to set for the call * @return The raw response object * @throws If the HTTP response code is non 2xx */ static post({ url, body, headers }: PostOptions): Promise; /** * Checks if the response HTTP code is an error code, and if so, throws an error * @param response The raw response object * @throws If the HTTP response code is non 2xx * @private */ private static _handleErrorResponse; }