Auf dieser Seite

QCoapRequest Class

Die Klasse „QCoapRequest“ enthält eine CoAP-Anfrage. Diese Anfrage kann mit „ QCoapClient “ gesendet werden. Mehr...

Header: #include <QCoapRequest>
CMake: find_package(Qt6 REQUIRED COMPONENTS Coap)
target_link_libraries(mytarget PRIVATE Qt6::Coap)
qmake: QT += coap
Erbt: QCoapMessage

Hinweis: Alle Funktionen 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)

Ausführliche Beschreibung

Das `QCoapRequest`-Objekt enthält Daten, die zur 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)

Erstellt ein `QCoapRequest`-Objekt aus einem String-Literal

[explicit] QCoapRequest::QCoapRequest(const QUrl &url = QUrl(), QCoapMessage::Type type = Type::NonConfirmable, const QUrl &proxyUrl = QUrl())

Erstellt ein QCoapRequest-Objekt mit der Ziel- url, der Proxy-URL proxyUrl und der type der Nachricht.

QCoapRequest::QCoapRequest(const QCoapRequest &other)

Erstellt eine Kopie des QCoapRequest-Objekts „ other “.

[noexcept] QCoapRequest::~QCoapRequest()

Zerstört den „ 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 es sich bei der Anfrage um eine „observe“-Anfrage handelt.

Siehe auch enableObserve().

QtCoap::Method QCoapRequest::method() const

Gibt die Methode der Anfrage zurück.

QUrl QCoapRequest::proxyUrl() const

Gibt die Proxy-URI der Anfrage zurück. Ist diese ungültig, wird die Anfrage direkt gesendet.

Siehe auch setProxyUrl().

void QCoapRequest::setProxyUrl(const QUrl &proxyUrl)

Setzt die Proxy-URI der Anfrage auf die angegebene Adresse proxyUrl.

Siehe auch proxyUrl().

void QCoapRequest::setUrl(const QUrl &url)

Setzt die Ziel-URI der Anfrage auf die angegebene Adresse url.

Wird keine Angabe gemacht, wird standardmäßig das Schema „coap“ und der Port 5683 verwendet.

Siehe auch url().

QUrl QCoapRequest::url() const

Gibt die Ziel-URI der Anfrage zurück.

Siehe auch „ setUrl()“.

QCoapRequest &QCoapRequest::operator=(const QCoapRequest &other)

Erstellt eine Kopie von „ 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.