Python: read http data | Sololearn: Learn to code for FREE!


Python: read http data

i writing a server in python. and when access it, i got this data: (access using: b'GET / HTTP/1.1\r\nHost:\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\nConnection: keep-alive\r\nUpgrade-Insecure-Requests: 1\r\n\r\n' is there a module that can read all those datas? so it can be simple as in php.

3/21/2018 10:34:38 AM

Kevin AS

2 Answers

New Answer


I would suggest using the socket module. It is already installed once you install python on your pc. If you need help on the socket module, go watch sentdex’s tutorials on the socket module


unfortunately, that i use socket