Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What's New in MQTT 5.0 (3) | payload identification and content type

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Payload identification (Payload Format Indicator)

Of all the message types of MQTT 5.0, this attribute exists only in the testamentary attributes of PUBLISH messages and CONNECT messages.

The payload identification occupies only one byte size, and it has only 0 (0x00) and 1 (0x01) values.

In the MQTT CONNECT message, when the value of the payload identification of the testamentary attribute is 0, it means that the testamentary message is an undetermined byte. When the attribute value is 1, it means that the testamentary message is UTF-8-encoded character data, and the data in the testamentary payload (Will Payload) must conform to the definition of the standard UTF-8.

In the MQTT PUBLISH message, when the value of the payload identification of the PUBLISH attribute is 0, it means that the PUBLISH message is an undetermined byte. When the attribute value is 1, it means that the payload of the PUBLISH message is UTF-8-encoded character data, and the data in the PUBLISH message payload (Payload) must conform to the definition of the standard UTF-8.

Content type (Content Type)

Of all the message types of MQTT 5.0, this attribute also exists only in the testamentary attributes of PUBLISH messages and CONNECT messages. This property holds a UTF-8-encoded string that describes the contents of a testamentary or PUBLISH message.

It is determined by the application that sends and receives messages. The content type cannot be tampered with during message forwarding.

A typical application of content types is to store MIME types, such as text/plain for text files and audio/aac for audio files.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report