Publish

Typed publish - Publish

Since 6.2.0:

In Device OS 6.2 and later, typed publish is supported. This allows the Content-Type of the publish data to be specified, and allows for binary data payloads. The following types are supported:

Content Type Constant MIME Type Value
ContentType::TEXT text/plain; charset=utf-8 0
ContentType::JPEG image/jpeg 22
ContentType::PNG image/png 23
ContentType::BINARY application/octet-stream 42
ContentType::STRUCTURED 65001

Additionally, JSON (text/json) structured data is supported. This is encoded using an EventData object, which is a Variant. The Variant can be created from a JSON text string, or built programmatically by adding fields.