-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Labels
Description
Is it possible to add an option for undefined content in the response?
For my specific use I needed to send an unencoded payload back but the Coap Response node doesn't allow for that.
if (_checkContentFormat(contentFormat, "text/plain")) {
return msg.payload.toString();
} else if (_checkContentFormat(contentFormat, "json")) {
return JSON.stringify(msg.payload);
} else if (_checkContentFormat(contentFormat, "cbor")) {
return cbor.encode(msg.payload);
} else {
return msg.payload.toString();
To get my flow working I changed "text/plain" toreturn.msg.payload; but a better solution would be to have one more option for contentFormat, "undefined" with a return of msg.payload;