-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusage.html
More file actions
42 lines (37 loc) · 1.22 KB
/
usage.html
File metadata and controls
42 lines (37 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Usage</title>
</head>
<body>
<p id="result">...</p>
<script>
document.addEventListener("DOMContentLoaded", () => {
const resultBox = document.getElementById("result");
fetch("/API/GetService.php", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"ServiceName": "Test2",
"Parameters": {
"FirstName": "Mehdi",
"LastName": "RaTo"
}
})
}).then((response) => response.json()).then((response) => {
if (response.IsSuccess) {
resultBox.innerText = JSON.stringify(response.Result);
} else {
resultBox.innerText = `(${response.StatusCode}) ${response.Message}`;
}
}).catch((error) => {
resultBox.innerText = String(error);
});
});
</script>
</body>
</html>