Broken project to implement a cross-protocol browser in textual
1
2
3
4
5
6
7
8
|
import requests
class HttpProtocol():
def get(url):
try:
r = requests.get(url, timeout=5)
except Exception as e:
return ("text/error", ["error\n", str(e)])
return (r.headers['content-type'].split(';')[0], r)
|