Dateien
Hetzner-Backup/v2_adminpanel/test_api.html
2025-06-18 02:34:07 +02:00

38 Zeilen
1.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>API Test</title>
</head>
<body>
<h1>Test Customer Licenses API</h1>
<button onclick="testAPI()">Test API</button>
<pre id="result"></pre>
<script>
function testAPI() {
// Test mit einem bekannten Kunden
fetch('/api/customer/1/licenses')
.then(response => {
console.log('Response status:', response.status);
console.log('Response headers:', response.headers);
return response.text();
})
.then(text => {
console.log('Raw response:', text);
try {
const data = JSON.parse(text);
console.log('Parsed data:', data);
document.getElementById('result').textContent = JSON.stringify(data, null, 2);
} catch (e) {
console.error('Parse error:', e);
document.getElementById('result').textContent = 'Parse error: ' + e + '\n\nRaw response:\n' + text;
}
})
.catch(error => {
console.error('Fetch error:', error);
document.getElementById('result').textContent = 'Fetch error: ' + error;
});
}
</script>
</body>
</html>