Version: (using KDE Devel) Installed from: Compiled sources Per the source at: http://websvn.kde.org/trunk/KDE/kdelibs/khtml/ecma/xmlhttprequest.cpp and the commit messages at: http://lists.kde.org/?l=kde-commits&w=2&r=1&s The XMLHttpRequest object does not allow all HTTP methods. The module defines BANNED_HTTP_HEADERS, which includes several perfectly valid HTTP methods such as DELETE, HEAD, TRACE, OPTIONS, and PUT. Not having this feature in KHTML limits its ability to use REST-ful resources (see http://en.wikipedia.org/wiki/REST) that require such methods. Further, HTTP servers (and caches, proxies, and the like) are meant to restrict/allow/process requests based the HTTP method, not clients. See the HTTP RFC at http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html for a complete list of all HTTP methods.
I am working on a REST based script and was bitten by this. My application wants to create new resources via PUT and remove them via DELETE. The W3C specification [1] for XMLHttpRequest objects states that these methods are required. It looks like canSetRequestHeader still lists these as blacklisted. I am running konqueror version 4.1.00. For now I will test in Firefox, but I prefer to use konqueror on my own desktop. [1] http://www.w3.org/TR/XMLHttpRequest/#dependencies
This bug breaks Ubuntu One web UI file removals completely. The only supported methods are GET and POST and everything else is converted to GET request: kdelibs-728671/khtml/ecma/xmlhttprequest.cpp: void XMLHttpRequest::send(const QString& _body, int& ec) { ... if (method == "post") { ... job = KIO::http_post( url, buf, KIO::HideProgressInfo ); ... } else { job = KIO::get( url, KIO::NoReload, KIO::HideProgressInfo ); } ... } See https://bugs.launchpad.net/khtml/+bug/493813
Most implementations of XMLHttpRequest does support at least GET,POST,PUT and DELETE. The rest are low priority as they are not consistently implemented.
SVN commit 1195838 by orlovich: A couple of fixes/improvements for XHR: - Support custom request types (#122069) - Support the weirdo x-user-defined "encoding" which basically acts as a binary mode. With both of these fixes, we can boot up the WebODF demo and view some of the simpler documents. Doesn't work entirely though (one issue is a CSSOM one, but not sure if anything else is wrong) BUG: 122069 M +72 -22 xmlhttprequest.cpp M +5 -1 xmlhttprequest.h WebSVN link: http://websvn.kde.org/?view=rev&revision=1195838