request_content_format Property
The request content format.
Syntax
def get_request_content_format() -> int: ... def set_request_content_format(value: int) -> None: ...
request_content_format = property(get_request_content_format, set_request_content_format)
Default Value
-1
Remarks
When the class is operating in client mode (i.e., the listening property is disabled), this property specifies the content format that should be included in outgoing requests.
When the class is operating in server mode (i.e., the listening property is enabled), this property is populated with the content format included in incoming requests (if any) anytime the on_request event fires.
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 request, 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 |