summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/xhr/response-method.htm
blob: 1bf26bac79c8ebbb3e31c50cbb6cfce35b67ea6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<!doctype html>
<html>
  <head>
    <title>XMLHttpRequest: influence of HTTP method on response</title>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
  </head>
  <body>
    <div id="log"></div>
    <script>
      ["GET", "HEAD", "POST"].forEach(function(method) {
        test(function() {
          var client = new XMLHttpRequest()
          client.open(method, "resources/echo-method.py", false)
          client.send()
          assert_equals(client.responseText, (method === "HEAD" ? "" : method))
        }, method)
      })
    </script>
  </body>
</html>