summaryrefslogtreecommitdiff
path: root/browser/devtools/netmonitor/test/html_post-raw-test-page.html
blob: b3148a77e7b052db7719224174eb9eef356201e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!doctype html>

<html>
  <head>
    <meta charset="utf-8"/>
    <title>Network Monitor test page</title>
  </head>

  <body>
    <p>POST raw test</p>

    <script type="text/javascript">
      function post(aAddress, aMessage, aCallback) {
        var xhr = new XMLHttpRequest();
        xhr.open("POST", aAddress, true);

        xhr.onreadystatechange = function() {
          if (this.readyState == this.DONE) {
            aCallback();
          }
        };
        xhr.send(aMessage);
      }

      function performRequests() {
        var rawData = "Content-Type: application/x-www-form-urlencoded\r\n\r\nfoo=bar&baz=123";
        post("sjs_simple-test-server.sjs", rawData, function() {
          // Done.
        });
      }
    </script>
  </body>

</html>