Steps to reproduce: 1) Try to do a PUT or a DELETE using XMLHttpRequest. Actual results: A GET request is issued. Expected results: Expected the full suite of HTTP verbs to be supported or at least the API to fail detectably when a verb is not supported. Additional information: In order to implement a client for a clean RESTful Web service supporting full CRUD capabilities, PUT and DELETE are needed, too.
This also applies to other verbs not explicitly defined in the HTTP spec, such as SEARCH used in HTTP-DAV. In my case, this prevents me from writing a client to access Microsoft Exchange servers.
Comfirmed in ToT by source inspection; anything unknown is treated as a GET.
Would be nice to have a test case. Although w/o server side support, that might be hard.
Writing a synthetic test shouldn't be too hard (one could take one from bug 3810 as a model), but it would be very helpful to have an example of a "real life" application that uses this.
*** Bug 7390 has been marked as a duplicate of this bug. ***
Created attachment 6776 [details] proposed patch There are some differences between this implementaion and Firefox: 1) For null data, "Content-Length: 0" header is sent (isn't sent in Firefox). Looks like better behavior to me; besides, I don't think we have a choice, because this header is added by NSURLConnection. 2) HEAD is not implemented - there seems to be a crashing bug in NSURLConnection, <rdar://4460899>. 3) After #2 is fixed, we won't be sending a body in HEAD requests, just like we don't send it in GET ones. Firefox ignores the body in GET requests, but sends it in HEAD ones, which looks like a bug to me. Also fixed a bug: send(null) was actually sending characters "null" instead of an empty body.
Comment on attachment 6776 [details] proposed patch Should use String instead of QString in new code, like the new parameter to TransferJob. String converts itself into NSString without even calling getNSString().
Created attachment 6786 [details] proposed patch Addressed the comments.
Comment on attachment 6786 [details] proposed patch Change looks fine as is, but I have three comments: 1) Is there a test for the change in JSXMLHttpRequest.cpp? That change looks fine, but I'd like to see a test that was broken before and fixed now. 2) Since method is now a String you can use equalIgnoringCase rather than calling lower when comparing the method with head. 3) I would like the client pointer to be the first parameter to TransferJob and the method the second parameter, because the client pointer sort of a "back pointer to the claler" while the rest of the parameters are the specification of what the job is to do. The most important of these three is (1), but I think none are a big enough deal to prevent landing the patch. I'll say r=me.
(In reply to comment #9) 1) Yes, the tests call send(null) for all methods, and there were a lot of failures before I fixed this. 2) Actually, method in XMLHTTPRequest class is still a QString, I haven't changed it. 3) Done.
Committed r78043: <http://trac.webkit.org/changeset/78043>
(In reply to comment #11) > Committed r78043: <http://trac.webkit.org/changeset/78043> Sorry for the noise. I just mentioned this bug in a ChangeLog, it seems that webkit-patch was too smart this time.
This still remains fixed :)
Mass moving XML DOM bugs to the "DOM" Component.