test-network-request.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <!DOCTYPE HTML>
  2. <html dir="ltr" xml:lang="en-US" lang="en-US">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Console HTTP test page</title>
  6. <script type="text/javascript"><!--
  7. function makeXhr(aMethod, aUrl, aRequestBody, aCallback) {
  8. var xmlhttp = new XMLHttpRequest();
  9. xmlhttp.open(aMethod, aUrl, true);
  10. xmlhttp.onreadystatechange = function() {
  11. if (aCallback && xmlhttp.readyState == 4) {
  12. aCallback();
  13. }
  14. };
  15. xmlhttp.send(aRequestBody);
  16. }
  17. function testXhrGet(aCallback) {
  18. makeXhr('get', 'test-data.json', null, aCallback);
  19. }
  20. function testXhrWarn(aCallback) {
  21. makeXhr('get', 'http://example.com/browser/devtools/client/netmonitor/test/sjs_cors-test-server.sjs', null, aCallback);
  22. }
  23. function testXhrPost(aCallback) {
  24. makeXhr('post', 'test-data.json', "Hello world!", aCallback);
  25. }
  26. // --></script>
  27. </head>
  28. <body>
  29. <h1>Heads Up Display HTTP Logging Testpage</h1>
  30. <h2>This page is used to test the HTTP logging.</h2>
  31. <form action="https://example.com/browser/devtools/client/webconsole/test/test-network-request.html" method="post">
  32. <input name="name" type="text" value="foo bar"><br>
  33. <input name="age" type="text" value="144"><br>
  34. </form>
  35. </body>
  36. </html>