QCoapResource#
The QCoapResource
class holds information about a discovered resource. More…
Synopsis#
Functions#
def
contentFormat
()def
host
()def
interface
()def
maximumSize
()def
observable
()def
path
()def
resourceType
()def
setContentFormat
(contentFormat)def
setHost
(host)def
setInterface
(interface)def
setMaximumSize
(maximumSize)def
setObservable
(observable)def
setPath
(path)def
setResourceType
(resourceType)def
setTitle
(title)def
swap
(other)def
title
()
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 as the path and title of the resource and other ancillary information.
See also
- class PySide6.QtCoap.QCoapResource#
PySide6.QtCoap.QCoapResource(other)
- Parameters:
other –
PySide6.QtCoap.QCoapResource
Constructs a new QCoapResource
.
Constructs a new CoAP resource as a copy of other
, making the two resources identical.
- PySide6.QtCoap.QCoapResource.contentFormat()#
- Return type:
uint
Returns the Content-Format code of the resource.
The Content-Format code corresponds to the ‘ct’ attribute and provides a hint about the Content-Formats this resource returns. It is specified in RFC 7252 .
See also
- PySide6.QtCoap.QCoapResource.host()#
- Return type:
Returns the host of the resource.
See also
- PySide6.QtCoap.QCoapResource.interface()#
- Return type:
str
Returns the interface description of the resource.
The Interface Description ‘if’ attribute is an opaque string used to provide a name or URI indicating a specific interface definition used to interact with the target resource. It is specified in RFC 6690 .
See also
- PySide6.QtCoap.QCoapResource.maximumSize()#
- Return type:
int
Returns the maximum size of the resource.
The maximum size estimate attribute ‘sz’ gives an indication of the maximum size of the resource representation returned by performing a GET on the target URI. It is specified in RFC 6690 .
See also
- PySide6.QtCoap.QCoapResource.observable()#
- Return type:
bool
Returns true
if the resource is observable
See also
- PySide6.QtCoap.QCoapResource.path()#
- Return type:
str
Returns the path of the resource.
See also
- PySide6.QtCoap.QCoapResource.resourceType()#
- Return type:
str
Returns the type of the resource.
See also
- PySide6.QtCoap.QCoapResource.setContentFormat(contentFormat)#
- Parameters:
contentFormat –
uint
Sets the content format of the resource to contentFormat
. The content format can be one of the content formats defined in CoAP Content-Formats Registry .
Note
CoAP supports common content formats such as XML, JSON, and so on, but these are text based and consequently heavy both in payload and in processing. One of the recommended content formats to use with CoAP is CBOR, which is designed to be used in such contexts.
See also
contentFormat()
QCborStreamWriter
QCborStreamReader
- PySide6.QtCoap.QCoapResource.setHost(host)#
- Parameters:
Sets the host of the resource to host
.
See also
- PySide6.QtCoap.QCoapResource.setInterface(interface)#
- Parameters:
interface – str
Sets the interface of the resource to interface
.
See also
- PySide6.QtCoap.QCoapResource.setMaximumSize(maximumSize)#
- Parameters:
maximumSize – int
Sets the maximum size of the resource to maximumSize
.
See also
- PySide6.QtCoap.QCoapResource.setObservable(observable)#
- Parameters:
observable – bool
Makes the resource observable if the observable
parameter is true
.
See also
- PySide6.QtCoap.QCoapResource.setPath(path)#
- Parameters:
path – str
Sets the path of the resource to path
.
See also
- PySide6.QtCoap.QCoapResource.setResourceType(resourceType)#
- Parameters:
resourceType – str
Sets the resource type to resourceType
.
See also
- PySide6.QtCoap.QCoapResource.setTitle(title)#
- Parameters:
title – str
Sets the title of the resource to title
.
See also
- PySide6.QtCoap.QCoapResource.swap(other)#
- Parameters:
other –
PySide6.QtCoap.QCoapResource
Swaps this resource with other
. This operation is very fast and never fails.
- PySide6.QtCoap.QCoapResource.title()#
- Return type:
str
Returns the title of the resource.
See also