Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
const httpClient = new DefaultHttpClient(NullLogger.instance);
httpClient.get(url).then((response) => {
if (response.statusCode >= 200 && response.statusCode < 300) {
resolve(response.content as string);
} else {
reject(new Error(response.statusText));
}
});
});
}