summaryrefslogtreecommitdiff
path: root/src/declarative
diff options
context:
space:
mode:
authorJani Honkonen <jani.honkonen@digia.com>2012-08-09 15:25:27 +0300
committerQt by Nokia <qt-info@nokia.com>2012-08-15 15:41:58 +0200
commit59d7bac9fb37178d9ec025dd91fb32f08e655d4d (patch)
tree4e8a7fc6cbb7b5b58e03519b159d07002a5031c3 /src/declarative
parentccaf9dad3f0b2292b21abe6be1b11bc1b7b94e71 (diff)
downloadqt4-tools-59d7bac9fb37178d9ec025dd91fb32f08e655d4d.tar.gz
XMLHttpRequest does not support the DELETE method
This is a backport from qt5 commit: 0eeb925aa5039ffddf8d623f250980fc4c97712e Task-number: QTBUG-17963 Change-Id: Ibc262e81d6c7d3b6882461627a7a312d1fbafb3b Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/qml/qdeclarativexmlhttprequest.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativexmlhttprequest.cpp b/src/declarative/qml/qdeclarativexmlhttprequest.cpp
index 4cc20bbc75..c2e7edb878 100644
--- a/src/declarative/qml/qdeclarativexmlhttprequest.cpp
+++ b/src/declarative/qml/qdeclarativexmlhttprequest.cpp
@@ -1163,6 +1163,8 @@ void QDeclarativeXMLHttpRequest::requestFromUrl(const QUrl &url)
m_network = networkAccessManager()->post(request, m_data);
else if(m_method == QLatin1String("PUT"))
m_network = networkAccessManager()->put(request, m_data);
+ else if (m_method == QLatin1String("DELETE"))
+ m_network = networkAccessManager()->deleteResource(request);
QObject::connect(m_network, SIGNAL(downloadProgress(qint64,qint64)),
this, SLOT(downloadProgress(qint64)));
@@ -1426,7 +1428,8 @@ static QScriptValue qmlxmlhttprequest_open(QScriptContext *context, QScriptEngin
if (method != QLatin1String("GET") &&
method != QLatin1String("PUT") &&
method != QLatin1String("HEAD") &&
- method != QLatin1String("POST"))
+ method != QLatin1String("POST") &&
+ method != QLatin1String("DELETE"))
THROW_DOM(SYNTAX_ERR, "Unsupported HTTP method type");