Pepguy commited on
Commit
fc849ba
·
verified ·
1 Parent(s): 1ec7afe

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +15 -3
index.html CHANGED
@@ -57,17 +57,29 @@
57
 
58
  async function del() {
59
  const key = document.getElementById('key').value;
60
- const res = await fetch('/delete?key=' + encodeURIComponent(key));
 
 
 
 
61
  document.getElementById('output').textContent = await res.text();
62
  }
63
 
64
  async function all() {
65
- const res = await fetch('/all');
 
 
 
 
66
  document.getElementById('output').textContent = JSON.stringify(await res.json(), null, 2);
67
  }
68
 
69
  async function backup() {
70
- const res = await fetch('/backup');
 
 
 
 
71
  document.getElementById('output').textContent = await res.text();
72
  }
73
  </script>
 
57
 
58
  async function del() {
59
  const key = document.getElementById('key').value;
60
+ const res = await fetch('/delete?key=' + encodeURIComponent(key), {
61
+ method: 'POST',
62
+
63
+ headers: { 'Content-Type': 'application/json' }
64
+ });
65
  document.getElementById('output').textContent = await res.text();
66
  }
67
 
68
  async function all() {
69
+ const res = await fetch('/all', {
70
+ method: 'POST',
71
+
72
+ headers: { 'Content-Type': 'application/json' }
73
+ });
74
  document.getElementById('output').textContent = JSON.stringify(await res.json(), null, 2);
75
  }
76
 
77
  async function backup() {
78
+ const res = await fetch('/backup', {
79
+ method: 'POST',
80
+
81
+ headers: { 'Content-Type': 'application/json' }
82
+ });
83
  document.getElementById('output').textContent = await res.text();
84
  }
85
  </script>