main.py519 chars18 linesIn the above code, we create an HTTP server that listens on port 8000. When a POST request is received, we read the request body using self.rfile.read(content_length) and decode it as UTF-8. We then parse the JSON data in the body with json.loads(body). Finally, we print the JSON data, but you can do whatever you want with it.
gistlibby LogSnag