|
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 <title>Network Monitor test page</title> |
|
9 </head> |
|
10 |
|
11 <body> |
|
12 <p>POST raw test</p> |
|
13 |
|
14 <script type="text/javascript"> |
|
15 function post(aAddress, aMessage, aCallback) { |
|
16 var xhr = new XMLHttpRequest(); |
|
17 xhr.open("POST", aAddress, true); |
|
18 xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded"); |
|
19 |
|
20 xhr.onreadystatechange = function() { |
|
21 if (this.readyState == this.DONE) { |
|
22 aCallback(); |
|
23 } |
|
24 }; |
|
25 xhr.send(aMessage); |
|
26 } |
|
27 |
|
28 function performRequests() { |
|
29 var rawData = "foo=bar&baz=123"; |
|
30 post("sjs_simple-test-server.sjs", rawData, function() { |
|
31 // Done. |
|
32 }); |
|
33 } |
|
34 </script> |
|
35 </body> |
|
36 |
|
37 </html> |