browser/devtools/netmonitor/test/html_post-raw-with-headers-test-page.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/devtools/netmonitor/test/html_post-raw-with-headers-test-page.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +<!-- Any copyright is dedicated to the Public Domain.
     1.5 +     http://creativecommons.org/publicdomain/zero/1.0/ -->
     1.6 +<!doctype html>
     1.7 +
     1.8 +<html>
     1.9 +  <head>
    1.10 +    <meta charset="utf-8"/>
    1.11 +    <title>Network Monitor test page</title>
    1.12 +  </head>
    1.13 +
    1.14 +  <body>
    1.15 +    <p>POST raw with headers test</p>
    1.16 +
    1.17 +    <script type="text/javascript">
    1.18 +      function post(aAddress, aMessage, aCallback) {
    1.19 +        var xhr = new XMLHttpRequest();
    1.20 +        xhr.open("POST", aAddress, true);
    1.21 +
    1.22 +        xhr.onreadystatechange = function() {
    1.23 +          if (this.readyState == this.DONE) {
    1.24 +            aCallback();
    1.25 +          }
    1.26 +        };
    1.27 +        xhr.send(aMessage);
    1.28 +      }
    1.29 +
    1.30 +      function performRequests() {
    1.31 +        var rawData = [
    1.32 +          "content-type: application/x-www-form-urlencoded\r",
    1.33 +          "custom-header: hello world!\r",
    1.34 +          "\r",
    1.35 +          "\r",
    1.36 +          "foo=bar&baz=123"
    1.37 +        ];
    1.38 +        post("sjs_simple-test-server.sjs", rawData.join("\n"), function() {
    1.39 +          // Done.
    1.40 +        });
    1.41 +      }
    1.42 +    </script>
    1.43 +  </body>
    1.44 +
    1.45 +</html>

mercurial