8 lines
217 B
TypeScript
8 lines
217 B
TypeScript
export async function request(url: string) {
|
|
const response = await fetch(url);
|
|
if (response.ok) {
|
|
return response.arrayBuffer();
|
|
} else {
|
|
throw new Error("HTTP error status: " + response.status);
|
|
}
|
|
}
|