Azure / azure-iot-sdk-node

A Node.js SDK for connecting devices to Microsoft Azure IoT services
https://docs.microsoft.com/en-us/azure/iot-hub/
Other
261 stars 227 forks source link

IoT-Device Messages default encoding #872

Closed KamalAman closed 4 years ago

KamalAman commented 4 years ago

IoT Device messages should default to application/json content type and UTF-8 encoding.

    const message = new Message(JSON.stringify(data));
    message.contentEncoding = "utf-8";
    message.contentType = "application/json";

Currently users need to manually specify the default encoding and type to use things such as message routing in IoTHub based on the $body.

AB#7901112

anthonyvercolano commented 4 years ago

I would suggest that you make this request via user voice.

Not the first to ask this question. Essentially though this would be viewed as a breaking change. That does NOT stand much of chance of happening.

az-iot-builder-01 commented 4 years ago

@KamalAman, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey