homepage.html (721B)
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8" /> 5 <title>My homepage.</title> 6 <script> 7 async function updatestatus() { 8 try { 9 const result = await fetch("https://example.com/update", { 10 method: "POST", 11 body: JSON.stringify({ 12 auth: 13 "07eff565187b16414fb06064bca51cb20837eb99dd5a0637dfc8257819f0", 14 }), 15 headers: { "Content-type": "application/json; charset=UTF-8" }, 16 }); 17 const data = await result.json(); 18 console.log(data); 19 } catch (er) { 20 console.error(er); 21 } 22 } 23 </script> 24 </head> 25 <body onLoad="updatestatus()"></body> 26 </html>