QHttpServerRequest Class
Verkapselt eine HTTP-Anfrage. Mehr...
Kopfzeile: | #include <QHttpServerRequest> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS HttpServer) target_link_libraries(mytarget PRIVATE Qt6::HttpServer) |
qmake: | QT += httpserver |
Seit: | Qt 6.4 |
Öffentliche Typen
Öffentliche Funktionen
~QHttpServerRequest() | |
QByteArray | body() const |
QHttpHeaders | headers() && |
const QHttpHeaders & | headers() const & |
(since 6.5) QHostAddress | localAddress() const |
(since 6.5) quint16 | localPort() const |
QHttpServerRequest::Method | method() const |
QUrlQuery | query() const |
QHostAddress | remoteAddress() const |
(since 6.5) quint16 | remotePort() const |
(since 6.7) QSslConfiguration | sslConfiguration() const |
QUrl | url() const |
QByteArray | value(const QByteArray &key) const |
Verwandte Nicht-Mitglieder
QDebug | operator<<(QDebug debug, const QHttpServerRequest &request) |
Detaillierte Beschreibung
API für den Zugriff auf die verschiedenen Parameter einer eingehenden Anfrage.
Member Type Dokumentation
enum class QHttpServerRequest::Method
flags QHttpServerRequest::Methods
Dieser Enum-Typ spezifiziert eine HTTP-Anfrage-Methode:
Konstante | Wert | Beschreibung |
---|---|---|
QHttpServerRequest::Method::Unknown | 0x0000 | Eine unbekannte Methode. |
QHttpServerRequest::Method::Get | 0x0001 | HTTP GET-Methode. |
QHttpServerRequest::Method::Put | 0x0002 | HTTP PUT-Methode. |
QHttpServerRequest::Method::Delete | 0x0004 | HTTP DELETE-Methode. |
QHttpServerRequest::Method::Post | 0x0008 | HTTP POST-Methode. |
QHttpServerRequest::Method::Head | 0x0010 | HTTP HEAD-Methode. |
QHttpServerRequest::Method::Options | 0x0020 | HTTP OPTIONS-Verfahren. |
QHttpServerRequest::Method::Patch | 0x0040 | HTTP PATCH-Verfahren(RFC 5789). |
QHttpServerRequest::Method::Connect | 0x0080 | HTTP CONNECT-Methode. |
QHttpServerRequest::Method::Trace | 0x0100 | HTTP TRACE-Methode. |
QHttpServerRequest::Method::AnyKnown | Get | Put | Delete | Post | Head | Options | Patch | Connect | Trace | Kombination aus allen bekannten Methoden. |
Der Typ Methods ist ein Typedef für QFlags<Method>. Er speichert eine ODER-Kombination von Methodenwerten.
Dokumentation der Mitgliedsfunktionen
QHttpHeaders QHttpServerRequest::headers() &&
const QHttpHeaders &QHttpServerRequest::headers() const &
Gibt alle Header der Anfrage zurück.
[noexcept]
QHttpServerRequest::~QHttpServerRequest()
Zerstört eine QHttpServerRequest
QByteArray QHttpServerRequest::body() const
Gibt den Text der Anfrage zurück.
[since 6.5]
QHostAddress QHttpServerRequest::localAddress() const
Gibt die Hostadresse des lokalen Sockets zurück, der die Anfrage erhalten hat.
Diese Funktion wurde in Qt 6.5 eingeführt.
[since 6.5]
quint16 QHttpServerRequest::localPort() const
Gibt den Port des lokalen Sockets zurück, der die Anfrage erhalten hat.
Diese Funktion wurde in Qt 6.5 eingeführt.
QHttpServerRequest::Method QHttpServerRequest::method() const
Gibt die Methode der Anfrage zurück.
QUrlQuery QHttpServerRequest::query() const
Gibt die Abfrage in der Anfrage zurück.
QHostAddress QHttpServerRequest::remoteAddress() const
Gibt die Adresse des Ursprungshosts der Anfrage zurück.
[since 6.5]
quint16 QHttpServerRequest::remotePort() const
Gibt den Port des Ursprungshosts der Anfrage zurück.
Diese Funktion wurde in Qt 6.5 eingeführt.
[since 6.7]
QSslConfiguration QHttpServerRequest::sslConfiguration() const
Gibt die Konfiguration der aufgebauten TLS-Verbindung zurück. Die Konfigurationen geben true für isNull() zurück, wenn die Verbindung kein TLS verwendet.
Diese Funktion wurde in Qt 6.7 eingeführt.
QUrl QHttpServerRequest::url() const
Gibt die URL zurück, nach der die Anfrage gefragt hat.
QByteArray QHttpServerRequest::value(const QByteArray &key) const
Gibt den kombinierten Wert aller Kopfzeilen mit dem Namen key zurück.
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.