Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
src_network_access_qhttppart.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
5Content-Type: text/plain
6Content-Disposition: form-data; name="text"
7
8here goes the body
10
15textPart.setBody("here goes the body");
17
22imagePart.setRawHeader("Content-ID", "my@content.id"); // add any headers you like via setRawHeader()
23QFile *file = new QFile("image.jpg");
27
\inmodule QtCore
Definition qfile.h:93
QFILE_MAYBE_NODISCARD bool open(OpenMode flags) override
Opens the file using OpenMode mode, returning true if successful; otherwise false.
Definition qfile.cpp:904
The QHttpPart class holds a body part to be used inside a HTTP multipart MIME message.
void setBodyDevice(QIODevice *device)
Sets the device to read the content from to device.
void setHeader(QNetworkRequest::KnownHeaders header, const QVariant &value)
Sets the value of the known header header to be value, overriding any previously set headers.
void setBody(const QByteArray &body)
Sets the body of this MIME part to body.
void setRawHeader(const QByteArray &headerName, const QByteArray &headerValue)
Sets the header headerName to be of value headerValue.
\inmodule QtCore
Definition qvariant.h:65
QString text
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint name
Content Type
[0]
QHttpPart imagePart
[1]