html_cors-test-page.html (923B)
1 <!-- Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ --> 3 <!doctype html> 4 5 <html> 6 <head> 7 <meta charset="utf-8"/> 8 <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> 9 <meta http-equiv="Pragma" content="no-cache" /> 10 <meta http-equiv="Expires" content="0" /> 11 <title>Network Monitor test page</title> 12 </head> 13 14 <body> 15 <p>POST with CORS test page</p> 16 17 <script type="text/javascript"> 18 /* exported performRequests */ 19 "use strict"; 20 21 function post(url, contentType, postData) { 22 const xhr = new XMLHttpRequest(); 23 xhr.open("POST", url, true); 24 xhr.setRequestHeader("Content-Type", contentType); 25 xhr.send(postData); 26 } 27 28 function performRequests(url, contentType, postData) { 29 post(url, contentType, postData); 30 } 31 </script> 32 </body> 33 34 </html>