| Tests that sending undefined or null results in an empty request body. |
| var console_messages = document.createElement("ul"); |
| document.body.appendChild(console_messages); |
| var item = document.createElement("li"); |
| item.appendChild(document.createTextNode(message)); |
| console_messages.appendChild(item); |
| xhr = new XMLHttpRequest; |
| xhr.open("POST", "resources/post-echo.cgi", false); |
| if (!xhr.responseText.length) |
| log("PASS for undefined"); |
| log("FAILED: The posted content when sending 'undefined' is '" + xhr.responseText +"'. It should have been ''."); |
| xhr = new XMLHttpRequest; |
| xhr.open("POST", "resources/post-echo.cgi", false); |
| if (!xhr.responseText.length) |
| log("FAILED: The posted content when sending 'null' is '" + xhr.responseText +"'. It should have been ''."); |