Qt 6.x
The Qt SDK
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
4#ifndef QHTTPMULTIPART_H
5#define QHTTPMULTIPART_H
6
7#include <QtNetwork/qtnetworkglobal.h>
8#include <QtCore/QSharedDataPointer>
9#include <QtCore/QByteArray>
10#include <QtCore/QIODevice>
11#include <QtNetwork/QNetworkRequest>
12
13#ifndef Q_OS_WASM
15#endif
16
18
19
21class QHttpMultiPart;
22
23class Q_NETWORK_EXPORT QHttpPart
24{
25public:
26 QHttpPart();
28 ~QHttpPart();
29 QHttpPart &operator=(QHttpPart &&other) noexcept { swap(other); return *this; }
30 QHttpPart &operator=(const QHttpPart &other);
31
32 void swap(QHttpPart &other) noexcept { d.swap(other.d); }
33
34 bool operator==(const QHttpPart &other) const;
35 inline bool operator!=(const QHttpPart &other) const
36 { return !operator==(other); }
37
40
41 void setBody(const QByteArray &body);
43
44private:
46
48};
49
50Q_DECLARE_SHARED(QHttpPart)
51
53
54class Q_NETWORK_EXPORT QHttpMultiPart : public QObject
55{
57
58public:
59
64 AlternativeType
65 };
66
67 explicit QHttpMultiPart(QObject *parent = nullptr);
68 explicit QHttpMultiPart(ContentType contentType, QObject *parent = nullptr);
70
71 void append(const QHttpPart &httpPart);
72
73 void setContentType(ContentType contentType);
74
75 QByteArray boundary() const;
76 void setBoundary(const QByteArray &boundary);
77
78private:
79 Q_DECLARE_PRIVATE(QHttpMultiPart)
80 Q_DISABLE_COPY(QHttpMultiPart)
81
84};
85
87
88#endif // QHTTPMULTIPART_H
IOBluetoothDevice * device
\inmodule QtCore
Definition qbytearray.h:57
The QHttpMultiPart class resembles a MIME multipart message to be sent over HTTP.
ContentType
List of known content types for a multipart subtype as described in RFC 2046 and others.
The QHttpPart class holds a body part to be used inside a HTTP multipart MIME message.
bool operator!=(const QHttpPart &other) const
Returns true if this object is not the same as other.
QHttpPart & operator=(QHttpPart &&other) noexcept
void swap(QHttpPart &other) noexcept
\inmodule QtCore \reentrant
Definition qiodevice.h:34
The QNetworkAccessManager class allows the application to send network requests and receive replies.
KnownHeaders
List of known header types that QNetworkRequest parses.
\inmodule QtCore
Definition qobject.h:90
\inmodule QtCore
Definition qshareddata.h:35
\inmodule QtCore
Definition qvariant.h:64
list append(new Employee("Blackpool", "Stephen"))
Combined button and popup list for selecting options.
static QString header(const QString &name)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static QByteArray headerValue(QNetworkRequest::KnownHeaders header, const QVariant &value)
static QByteArray headerName(QNetworkRequest::KnownHeaders header)
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1219
#define QT_REQUIRE_CONFIG(feature)
#define Q_OBJECT
QSharedPointer< T > other(t)
[5]
this swap(other)
imagePart setBodyDevice(file)
textPart setBody("my text")
textPart setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"text\""))
imagePart setRawHeader("Content-ID", "my@content.id")
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent