JSON send to TCP

this is an example of sending a command via terminal the result OK
{"CommuniqueType":"ReadRequest","Header":{"Url":"/server/status/ping"}}

I tried to connect via TCP and send the command, but the result is an error.

if I check from terminal there is an error here
image

I hope someone can help me.

As a first test, what happens if you enter {"CommuniqueType":"ReadRequest","Header":{"Url":"/server/status/ping"}} into an inject node (as a str not json) and connect that to the TCP request,

e.g.

  1. INJECT (set payload to string {"CommuniqueType":"ReadRequest","Header":{"Url":"/server/status/ping"}} ) →
  2. TCP request →
  3. Debug

As I see it, the JSON node is formatting the JSON with spaces and newlines
image and I suspect the newlines are causing the other end to think that is the end of transmission.

Additionally, how is the TCP node set up (show me please)

I have tried with "inject node" but it doesn't output any result in debug.

this my TCP setup
flows.json (2.9 KB)

Try adding a newline - use a function node between inject and TCP...

msg.payload += "\n"
return msg

working well...

thank's steve...

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.