-
Hi, Is there a reason why in the SDK, the payload of the Direct Methods (creation of the Direct Method) can only be JSON? Direct Methods handlers do not require this. I was starting to code it and push the PR but, there is maybe a reason. So, before going any further, I prefer to ask the question. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi @jonmikeli - We're talking about it within the team. The (probably) short answer is that when the SDKs were originally built, the authors thought JSON would be the only format someone would care about. I'm sure that is shortsighted. Can you say more about what format you'd like to be able to send? Also, what format have you sent over IoT Explorer? I know, for instance, that you can pass JSON primitives, like Thanks, |
Beta Was this translation helpful? Give feedback.
-
Hi @drwill-ms , Thank you for your answer. We have been sending numeric values or short strings to Direct Methods, through the IoT Explorer.
There is no problem in sending the appropriate JSON but I was wondering if there was a reason why the calling Direct Methods and the handlers are not designed to process the payload in the same way (main reason for my question, no blocking issue). Similarly to the authors, at first, I would have thought that JSON could be enough. Best, |
Beta Was this translation helpful? Give feedback.
-
JSON doesn't mean it must be a JSON object (e.g., As for hexadecimal or encrypted raw data, we haven't had requests from customers for .NET or Java SDKs, although I'd agree it might be useful for someone. If that is a use case for you, please let us know. :) |
Beta Was this translation helpful? Give feedback.
Hi @jonmikeli -
We're talking about it within the team. The (probably) short answer is that when the SDKs were originally built, the authors thought JSON would be the only format someone would care about. I'm sure that is shortsighted.
Can you say more about what format you'd like to be able to send?
Also, what format have you sent over IoT Explorer? I know, for instance, that you can pass JSON primitives, like
123
or[ "abc" ]
, which isn't a JSON document but is valid JSON.Thanks,
David