HTTP Request Debugging Script - requestDebugger.py

Shows the raw HTTP request including headers and JSON data

This is useful for debugging issues with the IoT Back Brace device if readings are not coming through OK.


In [ ]:
import socket

host = ''
port = 5000
backlog = 5
size = 1024
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((host, port))
s.listen(backlog)
while 1:
	client, address = s.accept()
	data = client.recv(size)
	if data:
		print(data)
		print(len(data))
	client.close()

In [ ]: