0

I need to post data like this to an open telnet

{
  "context" : "50EF2767",
  "data" : {
    "user_status" : "invisible"
  },
  "command" : "setStatus"
}

The data is multiline. I cannot copy-paste it, as telnet treats new lines as Enter.

I tried http://telnet-online.net/ and it works fine Strips new lines

But I need this for localhost.

Is there any telnet client or any way to allow to post multiline data?

1

Try netcat (nc). See http://www.thegeekstuff.com/2012/04/nc-command-examples/?utm_source=feedburner for examples on how to use it.

  • Hi. Thanks for the suggestion. I tried nc localhost 8080 Thought it allows to post multiline, it strips brackets So I post ``` { "context" : "50EF2767", "data" : { "user_status" : "invisible" }, "command" : "setStatus" } ``` but the server recievs ``` "context" : "50EF2767", "data" : { "user_status" : "invisible" }, "command" : "setStatus" ``` Any suggestion? Thanks. – Gruz Jul 18 '17 at 9:10
  • Well, it basically works if prepending and postpending my data with new lines. There is a minor problem that if prepending a newline, it posts 2 messages - empty line and then the data. But without prepending it doesn't post the first bracket { – Gruz Jul 18 '17 at 9:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.