I am using the libraries http.server and http.client in order to build a server/client structure. The server is always on and the client makes requests.
When the server is called, it calls a scraper that returns a dictionary and currently I send it like this:
self.wfile.write(str(dictionary).encode("utf-8"))
However the client receives a String that I have to parse. Is it possible that the server could send a dictionary? (Or even better, a json)
You should try to use json.dumps({"a": 1, "b": 2}) and send your JSON object instead of encoding it as utf-8.
How to send a dictionary with python http server/client