-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-api.html
More file actions
36 lines (33 loc) · 1.11 KB
/
Copy pathtest-api.html
File metadata and controls
36 lines (33 loc) · 1.11 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
<!DOCTYPE html>
<html>
<head>
<title>PyClean API Test</title>
</head>
<body>
<h1>PyClean API Test</h1>
<button onclick="testAPI()">Test Clean API</button>
<pre id="result"></pre>
<script>
async function testAPI() {
const resultEl = document.getElementById('result');
resultEl.textContent = 'Testing...';
try {
const response = await fetch('http://localhost:8000/api/clean', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
csv_data: 'name,age\nJohn,25\nJane,',
dsl_script: 'CLEAN dataset;\nFILL_NULL age WITH 0;'
})
});
const data = await response.json();
resultEl.textContent = JSON.stringify(data, null, 2);
} catch (error) {
resultEl.textContent = 'Error: ' + error.message;
}
}
</script>
</body>
</html>