blob: 92705d6e9bc3d6b4606559bf888e124d6bc72c88 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
"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\"}");
});
|