Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qhttpnetworkheader_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QHTTPNETWORKHEADER_H
6#define QHTTPNETWORKHEADER_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists for the convenience
13// of the Network Access API. This header file may change from
14// version to version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtNetwork/private/qtnetworkglobal_p.h>
20#include <QtNetwork/private/qhttpheaderparser_p.h>
21#include <QtNetwork/qhttpheaders.h>
22
23#include <qshareddata.h>
24#include <qurl.h>
25
26#ifndef Q_OS_WASM
28#endif
29
31
33{
34public:
35 virtual ~QHttpNetworkHeader();
36 virtual QUrl url() const = 0;
37 virtual void setUrl(const QUrl &url) = 0;
38
39 virtual int majorVersion() const = 0;
40 virtual int minorVersion() const = 0;
41
42 virtual qint64 contentLength() const = 0;
43 virtual void setContentLength(qint64 length) = 0;
44
45 virtual QHttpHeaders header() const = 0;
46 virtual QByteArray headerField(QByteArrayView name, const QByteArray &defaultValue = QByteArray()) const = 0;
47 virtual void setHeaderField(const QByteArray &name, const QByteArray &data) = 0;
48};
49
50class Q_AUTOTEST_EXPORT QHttpNetworkHeaderPrivate : public QSharedData
51{
52public:
53 QUrl url;
54 QHttpHeaderParser parser;
55
56 QHttpNetworkHeaderPrivate(const QUrl &newUrl = QUrl());
57 QHttpNetworkHeaderPrivate(const QHttpNetworkHeaderPrivate &other) = default;
58 qint64 contentLength() const;
59 void setContentLength(qint64 length);
60
61 QByteArray headerField(QByteArrayView name, const QByteArray &defaultValue = QByteArray()) const;
62 QList<QByteArray> headerFieldValues(QByteArrayView name) const;
63 void setHeaderField(const QByteArray &name, const QByteArray &data);
64 void prependHeaderField(const QByteArray &name, const QByteArray &data);
65 void clearHeaders();
66 QHttpHeaders headers() const;
67 bool operator==(const QHttpNetworkHeaderPrivate &other) const;
68
69};
70
71
72QT_END_NAMESPACE
73
74#endif // QHTTPNETWORKHEADER_H
QT_REQUIRE_CONFIG(thread)