python socket json -- no JSON object could be decode <p>My python version is 2.7, and I encounter a problem as below picture <img src="https://i.stack.imgur.com/Y1OBH.jpg" alt="enter image description here"></p> <p><strong>This is the client</strong></p> <pre><code>name = raw_input("Please enter your username: ") passwd = raw_input("Please enter you password: ") data = {"username": name, "password": passwd} sock.connect((HOST,PORT)) sock.sendall(bytes(json.dumps(data)) </code></pre> <p><strong>And this is the server</strong></p> <pre><code>rcv_msg = json.loads(self.client_socket.recv(1024).strip()) print rcv_msg username = rcv_msg['username'] password = rcv_msg['password'] print "username: " + username print "password: " + password </code></pre> <p>However, I still get the username and password... Please someone help me to clean this bug~ Thanks</p>