OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <title>XMLHttpRequest: send() - data argument</title> |
| 5 <script src="/resources/testharness.js"></script> |
| 6 <script src="/resources/testharnessreport.js"></script> |
| 7 <link rel="help" href="https://xhr.spec.whatwg.org/#the-send()-method" data-
tested-assertations="/following::ol/li[4]" /> |
| 8 </head> |
| 9 <body> |
| 10 <div id="log"></div> |
| 11 <script> |
| 12 // Taken from http://w3c-test.org/XMLHttpRequest/send-entity-body-basic.ht
m |
| 13 |
| 14 function request(input, output) { |
| 15 test(function() { |
| 16 var client = new XMLHttpRequest() |
| 17 client.open("POST", "resources/echo-content.php", false) |
| 18 client.send(input) |
| 19 assert_equals(client.responseText, output) |
| 20 }, document.title + " (" + output + ")") |
| 21 } |
| 22 request(1, "1") |
| 23 request(10000000, "10000000") |
| 24 request([2,2], "2,2") |
| 25 request(false, "false") |
| 26 request("A\0A", "A\0A") |
| 27 request(new URLSearchParams([[1, 2], [3, 4]]), "1=2&3=4") |
| 28 </script> |
| 29 </body> |
| 30 </html> |
OLD | NEW |