3 <p>Tests for
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=3812"> bug
3812</a> -
4 GET and POST should not be the only HTTP methods implemented in XMLHttpRequest.
</p>
7 testRunner
.dumpAsText();
9 var console_messages
= document
.createElement("ol");
10 document
.body
.appendChild(console_messages
);
14 var item
= document
.createElement("li");
15 item
.appendChild(document
.createTextNode(message
));
16 console_messages
.appendChild(item
);
20 req
= new XMLHttpRequest
;
21 req
.open("GET", "methods.cgi", false);
23 log('GET(""): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
25 req
.open("GET", "methods.cgi", false);
27 log('GET(null): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
29 req
.open("GET", "methods.cgi", false);
31 log('GET("123"): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
33 req
.open("POST", "methods.cgi", false);
35 log('POST(""): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
37 req
.open("POST", "methods.cgi", false);
39 log('POST(null): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
41 req
.open("POST", "methods.cgi", false);
43 log('POST("123"): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
45 req
.open("PUT", "methods.cgi", false);
47 log('PUT(""): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
49 req
.open("PUT", "methods.cgi", false);
51 log('PUT(null): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
53 req
.open("PUT", "methods.cgi", false);
55 log('PUT("123"): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
57 req
.open("DELETE", "methods.cgi", false);
59 log('DELETE(""): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
61 req
.open("DELETE", "methods.cgi", false);
63 log('DELETE(null): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
65 req
.open("DELETE", "methods.cgi", false);
67 log('DELETE("123"): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
69 req
.open("HEAD", "methods.cgi", false);
71 log('HEAD(""): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
73 req
.open("HEAD", "methods.cgi", false);
75 log('HEAD(null): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
77 req
.open("HEAD", "methods.cgi", false);
79 log('HEAD("123"): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
81 req
.open("WKFOOBAR", "methods.cgi", false);
83 log('WKFOOBAR(""): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
85 req
.open("WKFOOBAR", "methods.cgi", false);
87 log('WKFOOBAR(null): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
89 req
.open("WKFOOBAR", "methods.cgi", false);
91 log('WKFOOBAR("123"): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
93 req
.open("SEARCH", "methods.cgi", false);
95 log('SEARCH(""): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
97 req
.open("SEARCH", "methods.cgi", false);
99 log('SEARCH(null): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));
101 req
.open("SEARCH", "methods.cgi", false);
103 log('SEARCH("123"): ' + req
.getResponseHeader("REQMETHOD") + "(" + req
.getResponseHeader("REQLENGTH") + " bytes), Content-Type: " + req
.getResponseHeader("REQTYPE"));