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);
217 qint64 contentLength() const;
224 void setContentLength(qint64 length);
287 void redirect(
const QUrl &url, quint16 status = Found);
301 void redirect(
const QString &url, quint16 status = Found);
320 void redirectSafe(
const QUrl &url,
const QUrl &fallback);
325 QUrl location() const noexcept;
347 bool isFinalizedHeaders() const noexcept;
352 bool isSequential() const noexcept override;
357 qint64 size() const noexcept override;
369 bool webSocketHandshake(const
QByteArray &key = {},
371 const QByteArray &protocol = {});
376 bool webSocketTextMessage(
const QString &message);
381 bool webSocketBinaryMessage(
const QByteArray &message);
391 bool webSocketPing(
const QByteArray &payload = {});
400 bool webSocketClose(quint16 code = Response::CloseCodeNormal,
const QString &reason = {});
406 explicit Response(
const Headers &defaultHeaders, EngineRequest *conn =
nullptr);
415 virtual qint64 writeData(
const char *data, qint64 len)
override;
420 virtual qint64 readData(
char *data, qint64 maxlen)
override;
422 ResponsePrivate *d_ptr;
423 friend class Application;
425 friend class EngineConnection;
426 friend class Context;
427 friend class ContextPrivate;