[Patches] [ python-Patches-1111653 ] HEAD/PUT/DELETE support for urllib2.py

SourceForge.net noreply at sourceforge.net
Fri Jan 28 19:53:14 CET 2005


Patches item #1111653, was opened at 2005-01-28 11:53
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1111653&group_id=5470

Category: Library (Lib)
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Terrel Shumway (drurl)
Assigned to: Nobody/Anonymous (nobody)
Summary: HEAD/PUT/DELETE support for urllib2.py

Initial Comment:
urllib2 only supports GET or POST HTTP request methods.
 This patch adds support for other methods.

>>> import urllib2
>>> r =
urllib2.Request("http://jdiworks.net/",method="HEAD")
>>> u = urllib2.urlopen(r)
>>> u.read()
''
>>> h = u.headers.getheader
>>> h("content-length")
'4754'
>>> h("accept-ranges")
'bytes'
>>> h("date")
'Fri, 28 Jan 2005 18:39:04 GMT'
>>> h("etag")
'"728074-1292-314c1c40"'
>>> h("last-modified")
'Thu, 01 Jul 2004 23:11:37 GMT'

TODO: fix 3xx redirect with a HEAD

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1111653&group_id=5470


More information about the Patches mailing list