QCoapRequest Class
La classe `QCoapRequest` contiene una richiesta CoAP. Questa richiesta può essere inviata tramite ` QCoapClient`. Per saperne di più...
| Intestazione: | #include <QCoapRequest> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Coap) target_link_libraries(mytarget PRIVATE Qt6::Coap) |
| qmake: | QT += coap |
| Eredita da: | QCoapMessage |
Nota: tutte le funzioni di questa classe sono rientranti.
Funzioni pubbliche
| QCoapRequest(const char *url, QCoapMessage::Type type = Type::NonConfirmable) | |
| QCoapRequest(const QUrl &url = QUrl(), QCoapMessage::Type type = Type::NonConfirmable, const QUrl &proxyUrl = QUrl()) | |
| QCoapRequest(const QCoapRequest &other) | |
| ~QCoapRequest() | |
| void | enableObserve() |
| bool | isObserve() const |
| QtCoap::Method | method() const |
| QUrl | proxyUrl() const |
| void | setProxyUrl(const QUrl &proxyUrl) |
| void | setUrl(const QUrl &url) |
| QUrl | url() const |
| QCoapRequest & | operator=(const QCoapRequest &other) |
Descrizione dettagliata
La classe QCoapRequest contiene i dati necessari per creare frame CoAP che possono essere inviati all'URL in essa contenuto.
Vedi anche QCoapClient, QCoapReply e QCoapResourceDiscoveryReply.
Documentazione delle funzioni membro
[explicit] QCoapRequest::QCoapRequest(const char *url, QCoapMessage::Type type = Type::NonConfirmable)
Crea un oggetto `QCoapRequest` a partire da una stringa letterale
[explicit] QCoapRequest::QCoapRequest(const QUrl &url = QUrl(), QCoapMessage::Type type = Type::NonConfirmable, const QUrl &proxyUrl = QUrl())
Crea un oggetto QCoapRequest con l'url di destinazione, l'URL del proxy proxyUrl e l'type del messaggio.
QCoapRequest::QCoapRequest(const QCoapRequest &other)
Crea una copia dell’oggetto QCoapRequest “ other ”.
[noexcept] QCoapRequest::~QCoapRequest()
Distrugge l’ QCoapRequest.
void QCoapRequest::enableObserve()
Imposta l'osservazione su true per effettuare una richiesta di osservazione.
Vedi anche isObserve().
bool QCoapRequest::isObserve() const
Restituisce true se la richiesta è una richiesta di osservazione.
Vedi anche enableObserve().
QtCoap::Method QCoapRequest::method() const
Restituisce il metodo della richiesta.
QUrl QCoapRequest::proxyUrl() const
Restituisce l'URI proxy della richiesta. Se tale URI non è valido, la richiesta verrà inviata direttamente.
Vedi anche setProxyUrl().
void QCoapRequest::setProxyUrl(const QUrl &proxyUrl)
Imposta l'URI del proxy della richiesta sul valore specificato proxyUrl.
Vedi anche proxyUrl().
void QCoapRequest::setUrl(const QUrl &url)
Imposta l'URI di destinazione della richiesta sull'indirizzo specificato url.
Se non specificato, lo schema dell'URL sarà impostato di default su 'coap', mentre la porta sarà impostata di default su 5683.
Vedi anche url().
QUrl QCoapRequest::url() const
Restituisce l'URI di destinazione della richiesta.
Vedi anche setUrl().
QCoapRequest &QCoapRequest::operator=(const QCoapRequest &other)
Crea una copia di other.
© 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.