IPWorks IoT 2020 Python Edition

Questions / Feedback?

response_content_format Property

The response content format.

Syntax

def get_response_content_format() -> int: ...
def set_response_content_format(value: int) -> None: ...

response_content_format = property(get_response_content_format, set_response_content_format)

Default Value

-1

Remarks

When the class is operating in client mode (i.e., the listening property is disabled), this property is populated with the content format included in incoming responses anytime the on_request_complete event fires.

When the class is operating in server mode (i.e., the listening property is enabled), this property specifies the content format that should be included in outgoing responses (regardless of whether they are sent immediately after on_request fires, or later using send_response or send_notification).

In either case, the valid set of values for this property is -1, or a value in the range 0 to 65535. -1 prevents a Content-Format option from being included when sending a response, or indicates that one was not included in a received response.

The following table provides a (non-exhaustive) list of some of the more common content formats; refer to the IANA's CoAP Content-Formats registry for a full list.

-1 (default) Content-Format option not included.
Value Media Type Encoding
0 text/plain; charset=utf-8
40 application/link-format
41 application/xml
42 application/octet-stream
47 application/exi
50 application/json
51 application/json-patch+json
52 application/merge-patch+json
60 application/cbor
61 application/cwt
62 application/multipart-core
63 application/cbor-seq
11050 application/json deflate
11060 application/cbor deflate

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks IoT 2020 Python Edition - Version 20.0 [Build 8265]