send-accept.htm (991B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>XMLHttpRequest: send() - Accept</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::code[contains(text(),'*/*')]/.. following::code[contains(text(),'Accept')]/.. following::code[contains(text(),'Accept')]/../following::ul[1]/li[1]" /> 8 </head> 9 <body> 10 <div id="log"></div> 11 <script> 12 test(function() { 13 var client = new XMLHttpRequest() 14 client.open("GET", "resources/accept.py", false) 15 client.send(null) 16 assert_equals(client.responseText, "*/*") 17 client.open("GET", "resources/accept.py", false) 18 client.setRequestHeader("Accept", "x-something/vague, text/html5") 19 client.send(null) 20 assert_equals(client.responseText, "x-something/vague, text/html5") 21 }) 22 </script> 23 </body> 24 </html>