class QCoapRequest

The QCoapRequest class holds a CoAP request. This request can be sent with QCoapClient . More

Inheritance diagram of PySide6.QtCoap.QCoapRequest

Synopsis

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

The QCoapRequest contains data needed to make CoAP frames that can be sent to the URL it holds.

__init__(other)
Parameters:

otherQCoapRequest

Constructs a copy of the other QCoapRequest .

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

  • typeType

Constructs a QCoapRequest from a string literal

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

Constructs a QCoapRequest object with the target url, the proxy URL proxyUrl and the type of the message.

enableObserve()

Sets the observe to true to make an observe request.

See also

isObserve()

isObserve()
Return type:

bool

Returns true if the request is an observe request.

See also

enableObserve()

method()
Return type:

Method

Returns the method of the request.

proxyUrl()
Return type:

QUrl

Returns the proxy URI of the request. The request shall be sent directly if this is invalid.

See also

setProxyUrl()

setProxyUrl(proxyUrl)
Parameters:

proxyUrlQUrl

Sets the proxy URI of the request to the given proxyUrl.

See also

proxyUrl()

setUrl(url)
Parameters:

urlQUrl

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.

See also

url()

url()
Return type:

QUrl

Returns the target URI of the request.

See also

setUrl()