| <html> |
| <body> |
| <p>Test that text/plain;charset=UTF-8 is set as default Content-Type for POST requests<br>with text content. Should print PASS.</p> |
| <div id="log"></div> |
| <script> |
| function log(message) { |
| document.getElementById("log").innerHTML += message + "<br>"; |
| } |
| |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| } |
| |
| var xhr = new XMLHttpRequest(); |
| |
| xhr.open("POST", "resources/xmlhttprequest-no-content-type-with-text.php"); |
| xhr.onerror = function () { |
| log("FAIL"); |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| }; |
| xhr.onload = function () { |
| if (xhr.readyState == 4) { |
| log(xhr.responseText); |
| if (window.testRunner) |
| testRunner.notifyDone(); |
| } |
| }; |
| xhr.send('Test'); |
| </script> |
| </html> |