summaryrefslogtreecommitdiffstats
path: root/src/network/access/qnetworkaccessmanager.cpp
diff options
context:
space:
mode:
authorPeter Hartmann <peter.hartmann@trolltech.com>2009-03-10 16:35:17 (GMT)
committerPeter Hartmann <peter.hartmann@trolltech.com>2009-06-05 14:32:02 (GMT)
commit100b55e4ddc9e4846ab877ea670473e2a9ed641e (patch)
tree237760daafc0f9bf6af1030fa8ab7f1c5c57c600 /src/network/access/qnetworkaccessmanager.cpp
parent1ad2cba32bc34786cdfd92ad16e3212b8830be3d (diff)
downloadQt-100b55e4ddc9e4846ab877ea670473e2a9ed641e.zip
Qt-100b55e4ddc9e4846ab877ea670473e2a9ed641e.tar.gz
Qt-100b55e4ddc9e4846ab877ea670473e2a9ed641e.tar.bz2
add HTTP DELETE support to Network Access API
added new method QNetworkAccessManager::deleteResource (naming the method "delete" was not possible since it is a reserverd word in C++) and adjusted all the internals necessary. Task-number: 242916 Reviewed-by: Thiago
Diffstat (limited to 'src/network/access/qnetworkaccessmanager.cpp')
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index bf06ede..7ca5f78 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -148,6 +148,9 @@ static void ensureInitialized()
\value PostOperation send the contents of an HTML form for
processing via HTTP POST (created with post())
+ \value DeleteOperation delete contents operation (created with
+ deleteResource())
+
\omitvalue UnknownOperation
\sa QNetworkReply::operation()
@@ -555,7 +558,7 @@ QNetworkReply *QNetworkAccessManager::head(const QNetworkRequest &request)
a new QNetworkReply object opened for reading which emits its
QIODevice::readyRead() signal whenever new data arrives.
- \sa post(), put()
+ \sa post(), put(), deleteResource()
*/
QNetworkReply *QNetworkAccessManager::get(const QNetworkRequest &request)
{
@@ -577,7 +580,7 @@ QNetworkReply *QNetworkAccessManager::get(const QNetworkRequest &request)
Note: sending a POST request on protocols other than HTTP and
HTTPS is undefined and will probably fail.
- \sa get(), put()
+ \sa get(), put(), deleteResource()
*/
QNetworkReply *QNetworkAccessManager::post(const QNetworkRequest &request, QIODevice *data)
{
@@ -642,6 +645,18 @@ QNetworkReply *QNetworkAccessManager::put(const QNetworkRequest &request, const
}
/*!
+ This function is used to send a request to delete the resource
+ identified by the URL of \a request.
+ This feature is currently available for HTTP only, performing an HTTP DELETE request.
+
+ \sa get(), post(), put()
+*/
+QNetworkReply *QNetworkAccessManager::deleteResource(const QNetworkRequest &request)
+{
+ return d_func()->postProcess(createRequest(QNetworkAccessManager::DeleteOperation, request));
+}
+
+/*!
Returns a new QNetworkReply object to handle the operation \a op
and request \a req. The device \a outgoingData is always 0 for Get and
Head requests, but is the value passed to post() and put() in