DmitrMakeev commited on
Commit
3ada825
·
verified ·
1 Parent(s): a94d0be

Update biz_v.html

Browse files
Files changed (1) hide show
  1. biz_v.html +21 -21
biz_v.html CHANGED
@@ -12,27 +12,27 @@
12
  <button id="sendRequestButton">Send Request</button>
13
  <textarea id="responseArea" rows="10" cols="50" readonly></textarea>
14
 
15
- <script>
16
- document.getElementById('sendRequestButton').addEventListener('click', function() {
17
- const token = document.getElementById('tokenInput').value;
18
- const url = '/send_request';
19
-
20
- fetch(url, {
21
- method: 'POST',
22
- headers: {
23
- 'Content-Type': 'application/x-www-form-urlencoded'
24
- },
25
- body: 'token=' + encodeURIComponent(token)
26
- })
27
- .then(response => response.json())
28
- .then(data => {
29
- document.getElementById('responseArea').value = JSON.stringify(data, null, 2);
30
- })
31
- .catch(error => {
32
- console.error('Error:', error);
33
- document.getElementById('responseArea').value = 'Error: ' + error.message;
34
- });
35
  });
36
- </script>
 
37
  </body>
38
  </html>
 
12
  <button id="sendRequestButton">Send Request</button>
13
  <textarea id="responseArea" rows="10" cols="50" readonly></textarea>
14
 
15
+ <script>
16
+ document.getElementById('sendRequestButton').addEventListener('click', function() {
17
+ const token = document.getElementById('tokenInput').value;
18
+ const url = '/send_request';
19
+ fetch(url, {
20
+ method: 'POST',
21
+ headers: {
22
+ 'Content-Type': 'application/x-www-form-urlencoded'
23
+ },
24
+ body: 'token=' + encodeURIComponent(token)
25
+ })
26
+ .then(response => response.json())
27
+ .then(data => {
28
+ console.log('JSON Response:', data); // Вывод JSON-ответа в консоль
29
+ document.getElementById('responseArea').value = JSON.stringify(data, null, 2);
30
+ })
31
+ .catch(error => {
32
+ console.error('Error:', error);
33
+ document.getElementById('responseArea').value = 'Error: ' + error.message;
 
34
  });
35
+ });
36
+ </script>
37
  </body>
38
  </html>