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
qrestreply.h
Go to the documentation of this file.
1
// Copyright (C) 2023 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
QRESTREPLY_H
6
#
define
QRESTREPLY_H
7
8
#
include
<
QtNetwork
/
qnetworkreply
.
h
>
9
10
#
include
<
QtCore
/
qpointer
.
h
>
11
12
#
include
<
optional
>
13
#
include
<
utility
>
14
15
QT_BEGIN_NAMESPACE
16
17
class
QByteArray;
18
class
QDebug;
19
struct
QJsonParseError;
20
class
QJsonDocument;
21
class
QString;
22
23
class
QRestReplyPrivate
;
24
class
QRestReply
25
{
26
public
:
27
Q_NETWORK_EXPORT
explicit
QRestReply
(
QNetworkReply
*
reply
);
28
Q_NETWORK_EXPORT
~
QRestReply
();
29
30
QRestReply
(
QRestReply
&&other)
noexcept
31
:
wrapped
(
std
::
move
(
other
.
wrapped
)),
32
d(
std
::exchange(other.d,
nullptr
))
33
{
34
}
35
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP
(
QRestReply
)
36
void
swap
(
QRestReply
&other)
noexcept
37
{
38
wrapped.swap(other.wrapped);
39
qt_ptr_swap(d, other.d);
40
}
41
42
Q_NETWORK_EXPORT QNetworkReply *
networkReply
()
const
;
43
44
Q_NETWORK_EXPORT std::optional<
QJsonDocument
>
readJson
(
QJsonParseError
*
error
=
nullptr
);
45
Q_NETWORK_EXPORT QByteArray
readBody
();
46
Q_NETWORK_EXPORT QString
readText
();
47
48
bool
isSuccess
()
const
49
{
50
return
!
hasError
() &&
isHttpStatusSuccess
();
51
}
52
Q_NETWORK_EXPORT
int
httpStatus
()
const
;
53
Q_NETWORK_EXPORT
bool
isHttpStatusSuccess
()
const
;
54
55
Q_NETWORK_EXPORT
bool
hasError
()
const
;
56
Q_NETWORK_EXPORT
QNetworkReply
::
NetworkError
error
()
const
;
57
Q_NETWORK_EXPORT
QString
errorString
()
const
;
58
59
private
:
60
#
ifndef
QT_NO_DEBUG_STREAM
61
friend
Q_NETWORK_EXPORT
QDebug
operator
<<(
QDebug
debug
,
const
QRestReply
&
reply
);
62
#
endif
63
QPointer<QNetworkReply> wrapped;
64
QRestReplyPrivate
*d =
nullptr
;
65
Q_DISABLE_COPY
(
QRestReply
)
66
};
67
68
Q_DECLARE_SHARED(QRestReply)
69
70
QT_END_NAMESPACE
71
72
#
endif
// QRESTREPLY_H
QByteArray::FromBase64Result
\inmodule QtCore
Definition
qbytearray.h:824
QRestAccessManagerPrivate
Definition
qrestaccessmanager_p.h:38
QRestAccessManagerPrivate::~QRestAccessManagerPrivate
~QRestAccessManagerPrivate() override
Definition
qrestaccessmanager.cpp:581
QRestAccessManagerPrivate::QRestAccessManagerPrivate
QRestAccessManagerPrivate()
QRestAccessManagerPrivate::activeRequests
QVarLengthFlatMap< QNetworkReply *, CallerInfo, 4 > activeRequests
Definition
qrestaccessmanager_p.h:64
QRestAccessManagerPrivate::executeRequest
QNetworkReply * executeRequest(ReqOpRef requestOperation, const QObject *context, QtPrivate::QSlotObjectBase *rawSlot)
Definition
qrestaccessmanager.cpp:856
QRestAccessManagerPrivate::deletesRepliesOnFinished
bool deletesRepliesOnFinished
Definition
qrestaccessmanager_p.h:67
QRestAccessManagerPrivate::executeRequest
QNetworkReply * executeRequest(ReqOpRefJson requestOperation, const QJsonDocument &jsonDoc, const QNetworkRequest &request, const QObject *context, QtPrivate::QSlotObjectBase *rawSlot)
Definition
qrestaccessmanager.cpp:868
QRestAccessManagerPrivate::qnam
QNetworkAccessManager * qnam
Definition
qrestaccessmanager_p.h:66
QRestAccessManagerPrivate::handleReplyFinished
void handleReplyFinished(QNetworkReply *reply)
Definition
qrestaccessmanager.cpp:833
QRestAccessManagerPrivate::createActiveRequest
QNetworkReply * createActiveRequest(QNetworkReply *reply, const QObject *contextObject, QtPrivate::SlotObjUniquePtr slot)
Definition
qrestaccessmanager.cpp:784
QRestAccessManagerPrivate::verifyThreadAffinity
void verifyThreadAffinity(const QObject *contextObject)
Definition
qrestaccessmanager.cpp:813
QRestAccessManager
The QRestAccessManager is a convenience wrapper for QNetworkAccessManager.
Definition
qrestaccessmanager.h:79
QRestReplyPrivate
Definition
qrestreply_p.h:29
QRestReply
QRestReply is a convenience wrapper for QNetworkReply.
Definition
qrestreply.h:25
QRestReply::httpStatus
Q_NETWORK_EXPORT int httpStatus() const
Returns the HTTP status received in the server response.
Definition
qrestreply.cpp:209
QRestReply::isHttpStatusSuccess
Q_NETWORK_EXPORT bool isHttpStatusSuccess() const
Returns whether the HTTP status is between 200..299.
Definition
qrestreply.cpp:230
QRestReply::QRestReply
QRestReply(QRestReply &&other) noexcept
Move-constructs the reply from other.
Definition
qrestreply.h:30
QRestReply::isSuccess
bool isSuccess() const
Returns whether the HTTP status is between 200..299 and no further errors have occurred while receivi...
Definition
qrestreply.h:48
QRestReply::hasError
Q_NETWORK_EXPORT bool hasError() const
Returns whether an error has occurred.
Definition
qrestreply.cpp:245
QRestReply::swap
void swap(QRestReply &other) noexcept
Definition
qrestreply.h:36
QRestReply::~QRestReply
Q_NETWORK_EXPORT ~QRestReply()
Destroys this QRestReply object.
Definition
qrestreply.cpp:61
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
Q_LOGGING_CATEGORY
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")
PATCH
static const QByteArray & PATCH()
Definition
qrestaccessmanager.cpp:714
QREST_METHOD_CUSTOM_WITH_DATA
#define QREST_METHOD_CUSTOM_WITH_DATA(DATA)
Definition
qrestaccessmanager.h:57
QREST_METHOD_NO_DATA
#define QREST_METHOD_NO_DATA(METHOD)
Definition
qrestaccessmanager.h:38
QREST_METHOD_WITH_DATA
#define QREST_METHOD_WITH_DATA(METHOD, DATA)
Definition
qrestaccessmanager.h:19
QRestAccessManagerPrivate::CallerInfo
Definition
qrestaccessmanager_p.h:60
QRestAccessManagerPrivate::CallerInfo::slot
QtPrivate::SlotObjUniquePtr slot
Definition
qrestaccessmanager_p.h:62
QRestAccessManagerPrivate::CallerInfo::contextObject
QPointer< const QObject > contextObject
Definition
qrestaccessmanager_p.h:61
qtbase
src
network
access
qrestreply.h
Generated on
for Qt by
1.18.0