QHttpServerRequest Class
Incapsula una richiesta HTTP. Maggiori informazioni...
| Intestazione: | #include <QHttpServerRequest> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS HttpServer) target_link_libraries(mytarget PRIVATE Qt6::HttpServer) |
| qmake: | QT += httpserver |
| A partire da: | Qt 6.4 |
Tipi pubblici
Funzioni pubbliche
(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) |
Elementi non membri correlati
| QDebug | operator<<(QDebug debug, const QHttpServerRequest &request) |
Documentazione sui tipi membro
enum class QHttpServerRequest::Method
flags QHttpServerRequest::Methods
Questo tipo di enumerazione specifica un metodo di richiesta HTTP:
| Costante | Valore | Descrizione |
|---|---|---|
QHttpServerRequest::Method::Unknown | 0x0000 | Un metodo sconosciuto. |
QHttpServerRequest::Method::Get | 0x0001 | Metodo HTTP GET. |
QHttpServerRequest::Method::Put | 0x0002 | Metodo HTTP PUT. |
QHttpServerRequest::Method::Delete | 0x0004 | Metodo HTTP DELETE. |
QHttpServerRequest::Method::Post | 0x0008 | Metodo HTTP POST. |
QHttpServerRequest::Method::Head | 0x0010 | Metodo HTTP HEAD. |
QHttpServerRequest::Method::Options | 0x0020 | Metodo HTTP OPTIONS. |
QHttpServerRequest::Method::Patch | 0x0040 | Metodo HTTP PATCH (RFC 5789). |
QHttpServerRequest::Method::Connect | 0x0080 | Metodo HTTP CONNECT. |
QHttpServerRequest::Method::Trace | 0x0100 | Metodo HTTP TRACE. |
QHttpServerRequest::Method::AnyKnown | Get | Put | Delete | Post | Head | Options | Patch | Connect | Trace | Combinazione di tutti i metodi noti. |
Il tipo Methods è un typedef per QFlags<Method>. Memorizza una combinazione OR di valori Method.
Documentazione delle funzioni membro
[since 6.10] QHttpServerRequest::QHttpServerRequest()
Crea un oggetto QHttpServerRequest.
Questa funzione è stata introdotta in Qt 6.10.
[since 6.10] QHttpServerRequest::QHttpServerRequest(const QHttpServerRequest &other)
La funzione `Copy` crea un oggetto `QHttpServerRequest` utilizzando ` other`.
Questa funzione è stata introdotta in Qt 6.10.
[constexpr noexcept default, since 6.10] QHttpServerRequest::QHttpServerRequest(QHttpServerRequest &&other)
Move crea un oggetto `QHttpServerRequest` utilizzando ` other`.
Questa funzione è stata introdotta in Qt 6.10.
[noexcept] QHttpServerRequest::~QHttpServerRequest()
Distrugge un QHttpServerRequest
QByteArray QHttpServerRequest::body() const
Restituisce il corpo della richiesta.
QHttpHeaders QHttpServerRequest::headers() &&
const QHttpHeaders &QHttpServerRequest::headers() const &
Restituisce tutte le intestazioni della richiesta.
[since 6.5] QHostAddress QHttpServerRequest::localAddress() const
Restituisce l'indirizzo host del socket locale che ha ricevuto la richiesta.
Questa funzione è stata introdotta in Qt 6.5.
[since 6.5] quint16 QHttpServerRequest::localPort() const
Restituisce la porta del socket locale che ha ricevuto la richiesta.
Questa funzione è stata introdotta in Qt 6.5.
QHttpServerRequest::Method QHttpServerRequest::method() const
Restituisce il metodo della richiesta.
QUrlQuery QHttpServerRequest::query() const
Restituisce la query contenuta nella richiesta.
QHostAddress QHttpServerRequest::remoteAddress() const
Restituisce l'indirizzo dell'host di origine della richiesta.
[since 6.5] quint16 QHttpServerRequest::remotePort() const
Restituisce la porta dell'host di origine della richiesta.
Questa funzione è stata introdotta in Qt 6.5.
[since 6.7] QSslConfiguration QHttpServerRequest::sslConfiguration() const
Restituisce la configurazione della connessione TLS stabilita. Se la connessione non utilizza TLS, la configurazione restituirà "true" alla chiamata a isNull().
Questa funzione è stata introdotta in Qt 6.7.
[noexcept, since 6.10] void QHttpServerRequest::swap(QHttpServerRequest &other)
Scambia i valori tra questa pagina e other.
Questa funzione è stata introdotta in Qt 6.10.
QUrl QHttpServerRequest::url() const
Restituisce l'URL richiesto dalla richiesta.
QByteArray QHttpServerRequest::value(const QByteArray &key) const
Restituisce il valore combinato di tutte le intestazioni con il nome key.
[noexcept, since 6.10] QHttpServerRequest &QHttpServerRequest::operator=(QHttpServerRequest &&other)
La funzione `Move` assegna un oggetto di tipo ` QHttpServerRequest ` utilizzando ` other`.
Questa funzione è stata introdotta in Qt 6.10.
[since 6.10] QHttpServerRequest &QHttpServerRequest::operator=(const QHttpServerRequest &other)
Assegna un oggetto ` QHttpServerRequest ` utilizzando ` other`.
Questa funzione è stata introdotta in Qt 6.10.
Elementi non membri correlati
QDebug operator<<(QDebug debug, const QHttpServerRequest &request)
Scrive le informazioni relative a request nel flusso debug.
Vedi anche QDebug.
© 2026 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.