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 |
|