# A simpel test script for netfortune server
# Copyright © 2017 Christian Rapp

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Echo client program
import socket
import json

HOST = '127.0.0.1'    # The remote host
PORT = 13              # The same port as used by the server
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
    s.connect((HOST, PORT))
    # s.sendall(b'Hello, world')
    data = s.recv(1024)
print('Received', repr(data))
j = json.loads(data)
print(json.dumps(j, indent=4, sort_keys=True))

@@ -755,16 +755,130 @@
 t json%0A%0A
+send_data = %7B%7D%0Asend_data%5B'category'%5D = 'fun'%0Asend_data%5B'bla'%5D = 'blub'%0Asend_j_data = json.dumps(send_data)%0Aprint %0A
 HOST = '
@@ -1062,18 +1062,16 @@
 RT))%0A   
- #
  s.senda
@@ -1077,28 +1077,98 @@
 all(
-b'Hello, world')%0A   
+(len(send_j_data)).to_bytes(2, byteorder='big'))%0A    s.sendall(send_j_data.encode())%0A    #
  dat
@@ -1184,16 +1184,18 @@
 v(1024)%0A
+# 
 print('R
@@ -1216,16 +1216,18 @@
 (data))%0A
+# 
 j = json
@@ -1235,24 +1235,26 @@
 loads(data)%0A
+# 
 print(json.d

Use python script to send json