18 #ifndef ENGINEREQUEST_H 19 #define ENGINEREQUEST_H 22 #include <QHostAddress> 23 #include <QElapsedTimer> 25 #include <Cutelyst/Headers> 38 FinalizedHeaders = 0x01,
44 Q_DECLARE_FLAGS(Status, StatusFlag)
54 virtual void finalizeBody();
62 virtual void finalizeError();
75 virtual void finalizeCookies();
82 virtual bool finalizeHeaders();
87 qint64 write(
const char *data, qint64 len);
89 bool webSocketHandshake(
const QString &key,
const QString &origin,
const QString &protocol);
91 virtual bool webSocketSendTextMessage(
const QString &message);
93 virtual bool webSocketSendBinaryMessage(
const QByteArray &message);
95 virtual bool webSocketSendPing(
const QByteArray &payload);
97 virtual bool webSocketClose(quint16 code,
const QString &reason);
103 virtual qint64 doWrite(
const char *data, qint64 len) = 0;
115 virtual void processingFinished();
120 virtual bool writeHeaders(quint16 status,
const Headers &headers) = 0;
122 virtual bool webSocketHandshakeDo(
const QString &key,
const QString &origin,
const QString &protocol);
131 void setPath(
char *rawPath,
const int len);
133 inline void setPath(
const QString &path) {
134 QByteArray rawPath = path.toLatin1();
135 setPath(rawPath.data(), rawPath.size());
164 quint64 startOfRequest = 0;
167 Status status = InitialState;
171 QIODevice *body =
nullptr;
178 quint16 remotePort = 0;
181 bool isSecure =
false;
189 Q_DECLARE_OPERATORS_FOR_FLAGS(Cutelyst::EngineRequest::Status)
191 #endif // ENGINEREQUEST_H QString path
Call setPath() instead.
QString protocol
The protocol requested by the user agent 'HTTP1/1'.
QElapsedTimer elapsed
The elapsed timer since the start of request.
QString remoteUser
The remote user name set by a front web server.
Headers headers
The request headers.
QHostAddress remoteAddress
The remote/client address.
The Cutelyst namespace holds all public Cutelyst API.
QString method
The method used (GET, POST...)
QString serverAddress
The server address which the server is listening to, usually the 'Host' header but if that's not pres...
QByteArray query
The query string requested by the user agent 'foo=bar&baz'.