Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /xhr/send-data-formdata.any.html - WPT Dashboard Interop Dashboard
- /xhr/send-data-formdata.any.worker.html - WPT Dashboard Interop Dashboard
// META: title=XMLHttpRequest.send(formdata)
var test = async_test();
test.step(function()
{
var xhr = new XMLHttpRequest();
var form = new FormData();
form.append("id", "0");
form.append("value", "zero");
xhr.onreadystatechange = test.step_func(() => {
if (xhr.readyState == 4) {
assert_equals(xhr.status, 200);
assert_equals(xhr.response, "id:0;value:zero;");
test.done();
}
});
xhr.open("POST", "./resources/form.py", true);
xhr.send(form);
});