Skip to content

Response payload option for "undefined" content #87

@JohnnyPicnic

Description

@JohnnyPicnic

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;

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions