test metadata

Script windmill Verified

by hugo697 ยท 3/6/2024

The script

Submitted by hugo697 Typescript (fetch-only)
Verified 370 days ago
1
/**
2
 * test metadata
3
 *
4
 */
5
export async function main(body: string) {
6
  const url = new URL(`${BASE_URL}/api/saml/test_metadata`);
7

8
  const response = await fetch(url, {
9
    method: "POST",
10
    headers: {
11
      "Content-Type": "application/json",
12
      Authorization: "Bearer " + WM_TOKEN,
13
    },
14
    body: JSON.stringify(body),
15
  });
16
  if (!response.ok) {
17
    const text = await response.text();
18
    throw new Error(`${response.status} ${text}`);
19
  }
20
  return await response.text();
21
}
22