15 lines
337 B
TypeScript
15 lines
337 B
TypeScript
export async function getMetadata(serviceUrl: string) {
|
|
const response = await fetch(serviceUrl, {
|
|
method: "GET",
|
|
mode: "cors",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
});
|
|
|
|
if (response.ok) {
|
|
return response.json();
|
|
} else {
|
|
throw new Error("HTTP error status: " + response.status);
|
|
}
|
|
}
|