Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /xhr/content-type-unmodified.any.html - WPT Dashboard Interop Dashboard
- /xhr/content-type-unmodified.any.worker.html - WPT Dashboard Interop Dashboard
"use strict";
async_test(t => {
const xhr = new XMLHttpRequest();
xhr.open("POST", "resources/echo-content-type.py");
xhr.setRequestHeader("content-type", "application/json; charset=UTF-8");
xhr.onerror = t.unreached_func("Error occurred.");
xhr.onload = t.step_func_done(() => {
assert_equals(xhr.status, 200);
assert_equals(xhr.responseText, "application/json; charset=UTF-8");
});
xhr.send("{ \"x\":\"a\"}");
});