The QCoapRequest class holds a CoAP request. This request can be sent with QCoapClient . 更多...
头: | #include <QCoapRequest> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS Coap)
target_link_libraries(mytarget PRIVATE Qt6::Coap) |
qmake: | QT += coap |
继承: | QCoapMessage |
注意: 此类的所有函数 可重入 .
QCoapRequest (const QUrl & url = QUrl(), QCoapMessage::Type type = Type::NonConfirmable, const QUrl & proxyUrl = QUrl()) | |
QCoapRequest (const char * url , QCoapMessage::Type type = Type::NonConfirmable) | |
QCoapRequest (const QCoapRequest & other ) | |
~QCoapRequest () | |
void | enableObserve () |
bool | isObserve () const |
QtCoap::Method | 方法 () const |
QUrl | proxyUrl () const |
void | setProxyUrl (const QUrl & proxyUrl ) |
void | setUrl (const QUrl & url ) |
QUrl | url () const |
QCoapRequest & | operator= (const QCoapRequest & other ) |
The QCoapRequest contains data needed to make CoAP frames that can be sent to the URL it holds.
另请参阅 QCoapClient , QCoapReply ,和 QCoapResourceDiscoveryReply .
[explicit]
QCoapRequest::
QCoapRequest
(const
QUrl
&
url
= QUrl(),
QCoapMessage::Type
type
= Type::NonConfirmable, const
QUrl
&
proxyUrl
= QUrl())
Constructs a QCoapRequest object with the target url , the proxy URL proxyUrl 和 type of the message.
[explicit]
QCoapRequest::
QCoapRequest
(const
char
*
url
,
QCoapMessage::Type
type
= Type::NonConfirmable)
Constructs a QCoapRequest from a string literal
构造副本为 other QCoapRequest.
销毁 QCoapRequest .
Sets the observe to
true
to make an observe request.
另请参阅 isObserve ().
返回
true
if the request is an observe request.
另请参阅 enableObserve ().
Returns the method of the request.
Returns the proxy URI of the request. The request shall be sent directly if this is invalid.
另请参阅 setProxyUrl ().
Sets the proxy URI of the request to the given proxyUrl .
另请参阅 proxyUrl ().
Sets the target URI of the request to the given url .
If not indicated, the scheme of the URL will default to 'coap', and its port will default to 5683.
另请参阅 url ().
Returns the target URI of the request.
另请参阅 setUrl ().
创建副本为 other .