You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
The text was updated successfully, but these errors were encountered:
Thank you for reporting this issue! Having another look into the underlying node-coap, it seems to me as if the .toString() call in the "else" case might be a bit redundant/unnecessary anyway. Maybe that could already be the fix here?
Is the return msg.payload tied to the type of content you select in the coap-response node?
For the device I'm working with the payload must not be formatted so I'm not sure if "text/plain" should be just msg.payload or if there should be another option for "raw-buffer"?
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.
To get my flow working I changed "text/plain" to
return.msg.payload;
but a better solution would be to have one more option for contentFormat, "undefined" with a return of msg.payload;The text was updated successfully, but these errors were encountered: