Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qhttpmultipart.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
QHTTPMULTIPART_H
6
#
define
QHTTPMULTIPART_H
7
8
#
include
<
QtNetwork
/
qtnetworkglobal
.
h
>
9
#
include
<
QtCore
/
QSharedDataPointer
>
10
#
include
<
QtCore
/
QByteArray
>
11
#
include
<
QtCore
/
QIODevice
>
12
#
include
<
QtNetwork
/
QNetworkRequest
>
13
14
#
ifndef
Q_OS_WASM
15
QT_REQUIRE_CONFIG
(
http
);
16
#
endif
17
18
QT_BEGIN_NAMESPACE
19
20
21
class
QHttpPartPrivate;
22
class
QHttpMultiPart;
23
class
QDebug;
24
25
class
Q_NETWORK_EXPORT
QHttpPart
26
{
27
public
:
28
QHttpPart();
29
QHttpPart(
const
QHttpPart &other);
30
~QHttpPart();
31
QHttpPart &operator=(QHttpPart &&other)
noexcept
{ swap(other);
return
*
this
; }
32
QHttpPart &operator=(
const
QHttpPart &other);
33
34
void
swap(QHttpPart &other)
noexcept
{ d.swap(other.d); }
35
36
bool
operator==(
const
QHttpPart &other)
const
;
37
inline
bool
operator!=(
const
QHttpPart &other)
const
38
{
return
!operator==(other); }
39
40
void
setHeader(QNetworkRequest::KnownHeaders header,
const
QVariant &value);
41
void
setRawHeader(
const
QByteArray &headerName,
const
QByteArray &headerValue);
42
43
void
setBody(
const
QByteArray &body);
44
void
setBodyDevice(QIODevice *device);
45
46
private
:
47
QSharedDataPointer<QHttpPartPrivate> d;
48
49
friend
class
QHttpMultiPartIODevice;
50
#
ifndef
QT_NO_DEBUG_STREAM
51
friend
Q_NETWORK_EXPORT QDebug operator<<(QDebug debug,
const
QHttpPart &httpPart);
52
#
endif
53
};
54
55
Q_DECLARE_SHARED
(
QHttpPart
)
56
57
class
QHttpMultiPartPrivate;
58
59
class
Q_NETWORK_EXPORT
QHttpMultiPart
:
public
QObject
60
{
61
Q_OBJECT
62
63
public
:
64
65
enum
ContentType {
66
MixedType,
67
RelatedType,
68
FormDataType,
69
AlternativeType
70
};
71
72
explicit
QHttpMultiPart(QObject *parent =
nullptr
);
73
explicit
QHttpMultiPart(ContentType contentType, QObject *parent =
nullptr
);
74
~QHttpMultiPart();
75
76
void
append(
const
QHttpPart &httpPart);
77
78
void
setContentType(ContentType contentType);
79
80
QByteArray boundary()
const
;
81
void
setBoundary(
const
QByteArray &boundary);
82
83
private
:
84
Q_DECLARE_PRIVATE(QHttpMultiPart)
85
Q_DISABLE_COPY(QHttpMultiPart)
86
87
friend
class
QNetworkAccessManager;
88
friend
class
QNetworkAccessManagerPrivate;
89
};
90
91
QT_END_NAMESPACE
92
93
#
endif
// QHTTPMULTIPART_H
QHttpMultiPart
The QHttpMultiPart class resembles a MIME multipart message to be sent over HTTP.
Definition
qhttpmultipart.h:60
QHttpPart
The QHttpPart class holds a body part to be used inside a HTTP multipart MIME message.
Definition
qhttpmultipart.h:26
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QT_REQUIRE_CONFIG
QT_REQUIRE_CONFIG(http)
qtbase
src
network
access
qhttpmultipart.h
Generated on
for Qt by
1.18.0