diff options
Diffstat (limited to 'src/core/api/qwebengineurlrequestjob.cpp')
-rw-r--r-- | src/core/api/qwebengineurlrequestjob.cpp | 73 |
1 files changed, 34 insertions, 39 deletions
diff --git a/src/core/api/qwebengineurlrequestjob.cpp b/src/core/api/qwebengineurlrequestjob.cpp index 3bb9d1732..b3997a49d 100644 --- a/src/core/api/qwebengineurlrequestjob.cpp +++ b/src/core/api/qwebengineurlrequestjob.cpp @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qwebengineurlrequestjob.h" @@ -148,7 +112,36 @@ QMap<QByteArray, QByteArray> QWebEngineUrlRequestJob::requestHeaders() const } /*! - Replies to the request with \a device and the MIME type \a contentType. + Returns a pointer to a QIODevice that gives access to the request body. + The request body can contain data for example when the request is + a POST request. If the request body is empty the QIODevice reflects this + and does not return any data when performing read operations on it. + + \since 6.7 + \sa QIODevice +*/ +QIODevice *QWebEngineUrlRequestJob::requestBody() const +{ + return d_ptr->requestBody(); +} + +/*! + \since 6.6 + Set \a additionalResponseHeaders. These additional headers of the response + are only used when QWebEngineUrlRequestJob::reply(const QByteArray&, QIODevice*) + is called. +*/ +void QWebEngineUrlRequestJob::setAdditionalResponseHeaders( + const QMultiMap<QByteArray, QByteArray> &additionalResponseHeaders) const +{ + d_ptr->setAdditionalResponseHeaders(additionalResponseHeaders); +} + +/*! + Replies to the request with \a device and the content type \a contentType. + Content type is similar to the HTTP Content-Type header, and can either be + a MIME type, or a MIME type and charset encoding combined like this: + "text/html; charset=utf-8". The user has to be aware that \a device will be used on another thread until the job is deleted. In case simultaneous access from the main thread @@ -189,3 +182,5 @@ void QWebEngineUrlRequestJob::redirect(const QUrl &url) } QT_END_NAMESPACE + +#include "moc_qwebengineurlrequestjob.cpp" |