Working with sockets
Reading one byte at a time is bad idea, because it won't buffer the input. Instead, you'll probably get a system call for each byte which will be really inefficient.

Easiest solution is to use makefile

myfile = sock.makefile('r') 


Then you can treat myfile like a file, including using methods like readline. That'll be more efficient then your version.

It seems a bit of waste to have readheaders() convert all the headers into one long string, only to have parseheaders() split it apart again.

if "Transfer-Encoding" in headersdict and headersdict["Transfer-Encoding"] == "chunked":


I'd use if headersdict.get('Transfer-Encoding') == 'chunked':, if the key is not present, get will return None, and you'll have the same effect as before.

Of course, for serious stuff, you'd want to use the builtin python libraries for this sort of thing. But as long as you are doing it to learn, all well and good.