-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Without this:
>>> from urllib.request import *
>>> r = Request('http://localhost:8989/')
>>> r.add_header('User-Agent', 'foo')
>>> urlopen(r)
GET / HTTP/1.1
Accept-Encoding: identity
Connection: close
Host: localhost:8989
User-Agent: foo
With this:
>>> from urllib.request import *
>>> from keepalive import HTTPHandler
>>> opener = build_opener(HTTPHandler())
>>> install_opener(opener)
>>> r = Request('http://localhost:8989/')
>>> r.add_header('User-Agent', 'foo')
>>> urlopen(r)
GET / HTTP/1.1
Host: localhost:8989
Accept-Encoding: identity
User-agent: Python-urllib/3.5 # <--- WAT
User-agent: foo