Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
changed the content type of telemetry to be application/json and utf-8
Browse files Browse the repository at this point in the history
  • Loading branch information
firedog1024 committed Aug 6, 2020
1 parent 646d8f4 commit eb8d0f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions MXCHIP/mxchip_advanced/src/iotc/sdk_plat/iotc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ static EVENT_INSTANCE *createEventInstance(IOTContextInternal *internal,
*errorCode = 9;
return NULL;
}

// set the message content type to application/json and utf-8
(void)IoTHubMessage_SetContentTypeSystemProperty(currentMessage->messageHandle, "application%2fjson");
(void)IoTHubMessage_SetContentEncodingSystemProperty(currentMessage->messageHandle, "utf-8");

currentMessage->internal = internal;
currentMessage->appContext = applicationContext;

Expand Down
5 changes: 5 additions & 0 deletions MXCHIP/mxchip_basic/src/iotc/sdk_plat/iotc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ static EVENT_INSTANCE *createEventInstance(IOTContextInternal *internal,
*errorCode = 9;
return NULL;
}

// set the message content type to application/json and utf-8
(void)IoTHubMessage_SetContentTypeSystemProperty(currentMessage->messageHandle, "application%2fjson");
(void)IoTHubMessage_SetContentEncodingSystemProperty(currentMessage->messageHandle, "utf-8");

currentMessage->internal = internal;
currentMessage->appContext = applicationContext;

Expand Down

0 comments on commit eb8d0f8

Please sign in to comment.