代码拉取完成,页面将自动刷新
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Copyright (C) 2022 Rochus Keller (me@rochus-keller.ch) for LeanQt
**
** This file is part of the QtNetwork module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QNETWORKREQUEST_H
#define QNETWORKREQUEST_H
#include <QtCore/QSharedDataPointer>
#include <QtCore/QString>
#include <QtCore/QUrl>
#include <QtCore/QVariant>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_NETWORKACCESS
class QSslConfiguration;
class QNetworkRequestPrivate;
class Q_NETWORK_EXPORT QNetworkRequest
{
public:
enum KnownHeaders {
ContentTypeHeader,
ContentLengthHeader,
LocationHeader,
LastModifiedHeader,
CookieHeader,
SetCookieHeader,
ContentDispositionHeader, // added for QMultipartMessage
UserAgentHeader,
ServerHeader
};
enum Attribute {
HttpStatusCodeAttribute,
HttpReasonPhraseAttribute,
RedirectionTargetAttribute,
ConnectionEncryptedAttribute,
CacheLoadControlAttribute,
CacheSaveControlAttribute,
SourceIsFromCacheAttribute,
DoNotBufferUploadDataAttribute,
HttpPipeliningAllowedAttribute,
HttpPipeliningWasUsedAttribute,
CustomVerbAttribute,
CookieLoadControlAttribute,
AuthenticationReuseAttribute,
CookieSaveControlAttribute,
MaximumDownloadBufferSizeAttribute, // internal
DownloadBufferAttribute, // internal
SynchronousRequestAttribute, // internal
BackgroundRequestAttribute,
SpdyAllowedAttribute,
SpdyWasUsedAttribute,
EmitAllUploadProgressSignalsAttribute,
FollowRedirectsAttribute,
User = 1000,
UserMax = 32767
};
enum CacheLoadControl {
AlwaysNetwork,
PreferNetwork,
PreferCache,
AlwaysCache
};
enum LoadControl {
Automatic = 0,
Manual
};
enum Priority {
HighPriority = 1,
NormalPriority = 3,
LowPriority = 5
};
explicit QNetworkRequest(const QUrl &url = QUrl());
QNetworkRequest(const QNetworkRequest &other);
~QNetworkRequest();
#ifdef Q_COMPILER_RVALUE_REFS
QNetworkRequest &operator=(QNetworkRequest &&other) Q_DECL_NOTHROW { swap(other); return *this; }
#endif
QNetworkRequest &operator=(const QNetworkRequest &other);
void swap(QNetworkRequest &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool operator==(const QNetworkRequest &other) const;
inline bool operator!=(const QNetworkRequest &other) const
{ return !operator==(other); }
QUrl url() const;
void setUrl(const QUrl &url);
// "cooked" headers
QVariant header(KnownHeaders header) const;
void setHeader(KnownHeaders header, const QVariant &value);
// raw headers:
bool hasRawHeader(const QByteArray &headerName) const;
QList<QByteArray> rawHeaderList() const;
QByteArray rawHeader(const QByteArray &headerName) const;
void setRawHeader(const QByteArray &headerName, const QByteArray &value);
// attributes
QVariant attribute(Attribute code, const QVariant &defaultValue = QVariant()) const;
void setAttribute(Attribute code, const QVariant &value);
#ifndef QT_NO_SSL
QSslConfiguration sslConfiguration() const;
void setSslConfiguration(const QSslConfiguration &configuration);
#endif
void setOriginatingObject(QObject *object);
QObject *originatingObject() const;
Priority priority() const;
void setPriority(Priority priority);
// HTTP redirect related
int maximumRedirectsAllowed() const;
void setMaximumRedirectsAllowed(int maximumRedirectsAllowed);
private:
QSharedDataPointer<QNetworkRequestPrivate> d;
friend class QNetworkRequestPrivate;
};
Q_DECLARE_SHARED(QNetworkRequest)
#else
class QNetworkRequest
{
public:
// TODO: take these enums out of NetworkRequest
enum KnownHeaders {
ContentTypeHeader,
ContentLengthHeader,
LocationHeader,
LastModifiedHeader,
CookieHeader,
SetCookieHeader,
ContentDispositionHeader, // added for QMultipartMessage
UserAgentHeader,
ServerHeader
};
enum Attribute {
HttpStatusCodeAttribute,
HttpReasonPhraseAttribute,
RedirectionTargetAttribute,
ConnectionEncryptedAttribute,
CacheLoadControlAttribute,
CacheSaveControlAttribute,
SourceIsFromCacheAttribute,
DoNotBufferUploadDataAttribute,
HttpPipeliningAllowedAttribute,
HttpPipeliningWasUsedAttribute,
CustomVerbAttribute,
CookieLoadControlAttribute,
AuthenticationReuseAttribute,
CookieSaveControlAttribute,
MaximumDownloadBufferSizeAttribute, // internal
DownloadBufferAttribute, // internal
SynchronousRequestAttribute, // internal
BackgroundRequestAttribute,
SpdyAllowedAttribute,
SpdyWasUsedAttribute,
EmitAllUploadProgressSignalsAttribute,
FollowRedirectsAttribute,
User = 1000,
UserMax = 32767
};
};
#endif // QT_NO_NETWORKACCESS
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QNetworkRequest)
#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。