QCoapRequest Class
Die Klasse QCoapRequest enthält eine CoAP-Anfrage. Diese Anfrage kann mit QCoapClient gesendet werden. Mehr...
Kopfzeile: | #include <QCoapRequest> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Coap) target_link_libraries(mytarget PRIVATE Qt6::Coap) |
qmake: | QT += coap |
Vererbt: | QCoapMessage |
Hinweis: Alle Funktionen in dieser Klasse sind reentrant.
Öffentliche Funktionen
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) |
Detaillierte Beschreibung
QCoapRequest enthält Daten, die für die Erstellung von CoAP-Frames benötigt werden, die an die darin enthaltene URL gesendet werden können.
Siehe auch QCoapClient, QCoapReply, und QCoapResourceDiscoveryReply.
Dokumentation der Mitgliedsfunktionen
[explicit]
QCoapRequest::QCoapRequest(const char *url, QCoapMessage::Type type = Type::NonConfirmable)
Konstruiert eine QCoapRequest aus einem String-Literal
[explicit]
QCoapRequest::QCoapRequest(const QUrl &url = QUrl(), QCoapMessage::Type type = Type::NonConfirmable, const QUrl &proxyUrl = QUrl())
Konstruiert ein QCoapRequest-Objekt mit dem Ziel url, der Proxy-URL proxyUrl und der type der Nachricht.
QCoapRequest::QCoapRequest(const QCoapRequest &other)
Konstruiert eine Kopie des other QCoapRequest.
[noexcept]
QCoapRequest::~QCoapRequest()
Zerstört die QCoapRequest.
void QCoapRequest::enableObserve()
Setzt die Beobachtung auf true
, um eine Beobachtungsanfrage zu stellen.
Siehe auch isObserve().
bool QCoapRequest::isObserve() const
Gibt true
zurück, wenn die Anfrage eine Beobachtungsanfrage ist.
Siehe auch enableObserve().
QtCoap::Method QCoapRequest::method() const
Gibt die Methode der Anfrage zurück.
QUrl QCoapRequest::proxyUrl() const
Gibt den Proxy-URI der Anfrage zurück. Ist dieser ungültig, wird die Anfrage direkt gesendet.
Siehe auch setProxyUrl().
void QCoapRequest::setProxyUrl(const QUrl &proxyUrl)
Setzt den Proxy-URI der Anfrage auf den angegebenen proxyUrl.
Siehe auch proxyUrl().
void QCoapRequest::setUrl(const QUrl &url)
Setzt den Ziel-URI der Anfrage auf den angegebenen url.
Wenn nicht angegeben, wird das Schema der URL standardmäßig auf "coap" und der Port standardmäßig auf 5683 gesetzt.
Siehe auch url().
QUrl QCoapRequest::url() const
Gibt den Ziel-URI der Anfrage zurück.
Siehe auch setUrl().
QCoapRequest &QCoapRequest::operator=(const QCoapRequest &other)
Erzeugt eine Kopie von other.
© 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.