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
(since 6.10) | QHttpServerRequest() |
(since 6.10) | QHttpServerRequest(const QHttpServerRequest &other) |
(since 6.10) | QHttpServerRequest(QHttpServerRequest &&other) |
~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 |
(since 6.10) void | swap(QHttpServerRequest &other) |
QUrl | url() const |
QByteArray | value(const QByteArray &key) const |
(since 6.10) QHttpServerRequest & | operator=(QHttpServerRequest &&other) |
(since 6.10) QHttpServerRequest & | operator=(const QHttpServerRequest &other) |
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-Anforderungsmethode:
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-Verfahren. |
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.
[since 6.10]
QHttpServerRequest::QHttpServerRequest()
Konstruiert eine QHttpServerRequest.
Diese Funktion wurde in Qt 6.10 eingeführt.
[since 6.10]
QHttpServerRequest::QHttpServerRequest(const QHttpServerRequest &other)
Copy konstruiert einen QHttpServerRequest mit other.
Diese Funktion wurde in Qt 6.10 eingeführt.
[noexcept, since 6.10]
QHttpServerRequest::QHttpServerRequest(QHttpServerRequest &&other)
Move konstruiert einen QHttpServerRequest mit other.
Diese Funktion wurde in Qt 6.10 eingeführt.
[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.
[noexcept, since 6.10]
void QHttpServerRequest::swap(QHttpServerRequest &other)
Tauscht die Werte zwischen diesem und other.
Diese Funktion wurde in Qt 6.10 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.
[noexcept, since 6.10]
QHttpServerRequest &QHttpServerRequest::operator=(QHttpServerRequest &&other)
Move weist eine QHttpServerRequest mit other zu.
Diese Funktion wurde in Qt 6.10 eingeführt.
[since 6.10]
QHttpServerRequest &QHttpServerRequest::operator=(const QHttpServerRequest &other)
Weist eine QHttpServerRequest mit other zu.
Diese Funktion wurde in Qt 6.10 eingeführt.
Verwandte Nicht-Mitglieder
QDebug operator<<(QDebug debug, const QHttpServerRequest &request)
Schreibt Informationen über request in den Stream debug.
Siehe auch QDebug.
© 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.