36 SwitchingProtocols = 101,
40 NonAuthoritativeInformation = 203,
45 MultipleChoices = 300,
46 MovedPermanently = 301,
51 TemporaryRedirect = 307,
52 PermanentRedirect = 308,
55 PaymentRequired = 402,
58 MethodNotAllowed = 405,
60 ProxyAuthenticationRequired = 407,
65 PreconditionFailed = 412,
66 RequestEntityTooLarge = 413,
67 RequestURITooLong = 414,
68 UnsupportedMediaType = 415,
69 RequestedRangeNotSatisfiable = 416,
70 ExpectationFailed = 417,
71 InternalServerError = 500,
74 ServiceUnavailable = 503,
76 HTTPVersionNotSupported = 505,
77 BandwidthLimitExceeded = 509
83 CloseCodeNormal = 1000,
84 CloseCodeGoingAway = 1001,
85 CloseCodeProtocolError = 1002,
86 CloseCodeDatatypeNotSupported = 1003,
87 CloseCodeReserved1004 = 1004,
88 CloseCodeMissingStatusCode = 1005,
89 CloseCodeAbnormalDisconnection = 1006,
90 CloseCodeWrongDatatype = 1007,
91 CloseCodePolicyViolated = 1008,
92 CloseCodeTooMuchData = 1009,
93 CloseCodeMissingExtension = 1010,
94 CloseCodeBadOperation = 1011,
95 CloseCodeTlsHandshakeFailed = 1015
107 quint16 status() const noexcept;
112 void setStatus(quint16 status) noexcept;
119 bool hasBody() const noexcept;
152 inline
void setBody(const
QString &body);
170 void setCborValueBody(const
QCborValue &value);
196 void setJsonArrayBody(const
QJsonArray &array);
210 void setContentEncoding(const
QByteArray &encoding);
216 qint64 contentLength() const;
279 void redirect(
const QUrl &url, quint16 status = Found);
293 void redirect(
const QString &url, quint16 status = Found);
312 void redirectSafe(
const QUrl &url,
const QUrl &fallback);
317 QUrl location() const noexcept;
340 bool isFinalized() const noexcept;
345 bool isFinalizedHeaders() const noexcept;
350 bool isSequential() const noexcept override;
355 qint64 size() const noexcept override;
367 bool webSocketHandshake(const
QByteArray &key = {},
369 const QByteArray &protocol = {});
374 bool webSocketTextMessage(
const QString &message);
379 bool webSocketBinaryMessage(
const QByteArray &message);
389 bool webSocketPing(
const QByteArray &payload = {});
398 bool webSocketClose(quint16 code = Response::CloseCodeNormal,
const QString &reason = {});
404 explicit Response(
const Headers &defaultHeaders, EngineRequest *conn =
nullptr);
413 virtual qint64 writeData(
const char *data, qint64 len)
override;
418 virtual qint64 readData(
char *data, qint64 maxlen)
override;
420 ResponsePrivate *d_ptr;
421 friend class Application;
423 friend class EngineConnection;
424 friend class Context;
425 friend class ContextPrivate;