Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / devtools / client / netmonitor / test / html_post-raw-test-page.html
blob190d38404236d9c91737715b567108e9b053ab8d
1 <!-- Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ -->
3 <!doctype html>
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>
14 <body>
15 <p>POST raw test</p>
17 <script type="text/javascript">
18 /* exported performRequests */
19 "use strict";
21 function post(address, message) {
22 return new Promise(resolve => {
23 const xhr = new XMLHttpRequest();
24 xhr.open("POST", address, true);
25 xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded");
27 xhr.onreadystatechange = function() {
28 if (this.readyState == this.DONE) {
29 resolve();
32 xhr.send(message);
33 });
36 async function performRequests() {
37 const rawData = "foo=bar&baz=123";
38 await post("sjs_simple-test-server.sjs", rawData);
40 </script>
41 </body>
43 </html>