classification
Title: urllib2 headers issue
Type: behavior Stage:
Components: IO Versions: Python 2.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: orsenthil, shubhojeet.ghosh
Priority: normal Keywords:

Created on 2011-08-28 19:19 by shubhojeet.ghosh, last changed 2011-08-28 19:19 by shubhojeet.ghosh.

Messages (1)
msg143120 - (view) Author: Shubhojeet Ghosh (shubhojeet.ghosh) Date: 2011-08-28 19:19
There seems to be an issue with urllib2
The headers defined does not match with the physical data packet (from wireshark). Other header parameters such as User Agent, cookie works fine.
Here is an example of a failure:

Python Code:
import urllib2

url = "http://www.python.org"

req = urllib2.Request(url)
req.add_header('Connection',"keep-alive")
u = urllib2.urlopen(req)


Wireshark:
GET / HTTP/1.1

Accept-Encoding: identity

Connection: close

Host: www.python.org

User-Agent: Python-urllib/2.6
History
Date User Action Args
2011-08-28 19:19:27shubhojeet.ghoshcreate