python JSON object must be str, bytes or bytearray, not 'dict

json.loads
take a string as input and returns a dictionary as output, json.dumps
take a dictionary as input and returns a string as output.
python JSON object must be str, bytes or bytearray, not ‘dict