[New-bugs-announce] [issue15090] Add etag support to urllib.request.urlretrieve()

Raymond Hettinger report at bugs.python.org
Sun Jun 17 09:02:37 CEST 2012

New submission from Raymond Hettinger <raymond.hettinger at gmail.com>:

Add an optional argument to urlretrieve to specify an etag for previously downloaded content:

    >>> urlretrieve('example.com/data.txt', etag="105800d-4af6-4c29d893d69c0")

That optional argument would add the following to the outgoing headers:

    "If-None-Match: 105800d-4af6-4c29d893d69c0"

If the site returns a 304 Not Modified, then the full content download isn't needed.

components: Library (Lib)
messages: 163021
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Add etag support to urllib.request.urlretrieve()
type: enhancement
versions: Python 3.4

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list