PySide6.QtCoap.QCoapRequest

class QCoapRequest

QCoapRequest 类包含一个 CoAP 请求。此请求可以通过 QCoapClient 发送。更多

PySide6.QtCoap.QCoapRequest 的继承图

概要

方法

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述

QCoapRequest 包含生成可以发送到其持有的URL的CoAP帧所需的数据。

__init__(other)
Parameters:

其他QCoapRequest

构造一个 other QCoapRequest 的副本。

__init__(url[, type=QCoapMessage.Type.NonConfirmable])
Parameters:

从字符串字面量构造一个QCoapRequest

__init__([url=QUrl()[, type=QCoapMessage.Type.NonConfirmable[, proxyUrl=QUrl()]]])
Parameters:

构造一个QCoapRequest对象,目标为url,代理URL为proxyUrl,消息类型为type

enableObserve()

将观察设置为true以发出观察请求。

另请参阅

isObserve()

isObserve()
Return type:

布尔

如果请求是观察请求,则返回 true

另请参阅

enableObserve()

method()
Return type:

方法

返回请求的方法。

proxyUrl()
Return type:

QUrl

返回请求的代理URI。如果此URI无效,则请求应直接发送。

另请参阅

setProxyUrl()

setProxyUrl(proxyUrl)
Parameters:

proxyUrlQUrl

将请求的代理URI设置为给定的proxyUrl

另请参阅

proxyUrl()

setUrl(url)
Parameters:

urlQUrl

将请求的目标URI设置为给定的url

如果未指定,URL的方案将默认为‘coap’,其端口将默认为5683。

另请参阅

url()

url()
Return type:

QUrl

返回请求的目标URI。

另请参阅

setUrl()