5 #ifndef CUTELYST_REQUEST_H
6 #define CUTELYST_REQUEST_H
8 #include <Cutelyst/cutelyst_export.h>
9 #include <Cutelyst/headers.h>
10 #include <Cutelyst/paramsmultimap.h>
12 #include <QtCore/qobject.h>
13 #include <QtCore/qstringlist.h>
44 Q_PROPERTY(
QString hostname READ hostname CONSTANT)
45 Q_PROPERTY(quint16 port READ port CONSTANT)
46 Q_PROPERTY(
QUrl uri READ uri CONSTANT)
47 Q_PROPERTY(
QString base READ base CONSTANT)
48 Q_PROPERTY(
QString path READ path CONSTANT)
49 Q_PROPERTY(
QString match READ match CONSTANT)
50 Q_PROPERTY(
QStringList arguments READ arguments CONSTANT)
51 Q_PROPERTY(
QStringList args READ arguments CONSTANT)
52 Q_PROPERTY(
bool secure READ secure CONSTANT)
53 Q_PROPERTY(
QVariant bodyData READ bodyData CONSTANT)
56 Q_PROPERTY(
QByteArray contentEncoding READ contentEncoding CONSTANT)
57 Q_PROPERTY(
QByteArray contentType READ contentType CONSTANT)
58 Q_PROPERTY(
QByteArray method READ method CONSTANT)
59 Q_PROPERTY(
QByteArray protocol READ protocol CONSTANT)
60 Q_PROPERTY(
QByteArray userAgent READ userAgent CONSTANT)
61 Q_PROPERTY(
QByteArray referer READ referer CONSTANT)
62 Q_PROPERTY(
QString remoteUser READ remoteUser CONSTANT)
83 [[nodiscard]]
QString addressString()
const;
92 [[nodiscard]]
QString hostname()
const;
97 [[nodiscard]] quint16 port()
const noexcept;
103 [[nodiscard]]
QUrl uri()
const;
114 [[nodiscard]]
QString base()
const;
120 [[nodiscard]]
QString path()
const noexcept;
127 [[nodiscard]]
QString match()
const noexcept;
133 void setMatch(
const QString &match);
151 [[nodiscard]]
QStringList arguments()
const noexcept;
162 [[nodiscard]]
inline QStringList args()
const noexcept;
167 [[nodiscard]]
QStringList captures()
const noexcept;
182 [[nodiscard]]
bool secure()
const noexcept;
189 [[nodiscard]]
QIODevice *body()
const noexcept;
204 [[nodiscard]]
QVariant bodyData()
const;
228 [[nodiscard]]
QJsonArray bodyJsonArray()
const;
235 [[nodiscard]] QVariantMap bodyParametersVariant()
const;
247 const QString &defaultValue = {})
const;
265 const QString &defaultValue = {})
const;
281 [[nodiscard]]
QString queryKeywords()
const;
288 [[nodiscard]] QVariantMap queryParametersVariant()
const;
300 const QString &defaultValue = {})
const;
319 const QString &defaultValue = {})
const;
331 [[nodiscard]]
inline QByteArray contentEncoding()
const noexcept;
336 [[nodiscard]]
inline QByteArray contentType()
const;
368 [[nodiscard]]
Headers headers() const noexcept;
373 [[nodiscard]]
QByteArray method() const noexcept;
378 [[nodiscard]]
bool isPost() const noexcept;
383 [[nodiscard]]
bool isGet() const noexcept;
388 [[nodiscard]]
bool isHead() const noexcept;
393 [[nodiscard]]
bool isPut() const noexcept;
398 [[nodiscard]]
bool isPatch() const noexcept;
403 [[nodiscard]]
bool isDelete() const noexcept;
408 [[nodiscard]]
QByteArray protocol() const noexcept;
414 [[nodiscard]]
bool xhr() const noexcept;
419 [[nodiscard]] inline
QByteArray userAgent() const noexcept;
424 [[nodiscard]] inline
QByteArray referer() const noexcept;
429 [[nodiscard]]
QString remoteUser() const noexcept;
478 bool append = false) const;
498 [[nodiscard]]
Engine *engine() const noexcept;
543 void webSocketClosed(quint16 closeCode, const
QString &reason);
546 RequestPrivate *d_ptr;
563 return bodyParameters().
value(key, defaultValue);
568 return bodyParameters();
573 return bodyParameters().
value(key, defaultValue);
578 return bodyParameters(key);
583 return queryParameters().
value(key, defaultValue);
588 return queryParameters();
593 return queryParameters().
value(key, defaultValue);
598 return queryParameters(key);
603 return headers().contentEncoding();
608 return headers().contentType();
613 return headers().header(key);
618 return headers().userAgent();
623 return headers().referer();
628 return uploadsMap().value(name);
The Cutelyst application.
Abstract class to described a dispatch type.
QString queryParameter(const QString &key, const QString &defaultValue={}) const
QString bodyParameter(const QString &key, const QString &defaultValue={}) const
Upload * upload(QStringView name) const
QString queryParam(const QString &key, const QString &defaultValue={}) const
QString bodyParam(const QString &key, const QString &defaultValue={}) const
QByteArray header(QByteArrayView key) const noexcept
Cutelyst Upload handles file upload requests.
QVector< Upload * > Uploads
The Cutelyst namespace holds all public Cutelyst API.
T value(const Key &key, const T &defaultValue) const const