Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75094

Re: how to download special range content with requests in python?

References <tencent_11DB8BA910751CAB361D6B09@qq.com>
Date 2014-07-24 01:58 +1000
Subject Re: how to download special range content with requests in python?
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.12246.1406131138.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Jul 23, 2014 at 7:44 PM, 水静流深 <1248283536@qq.com> wrote:
> url='http://debian.cites.illinois.edu/pub/debian-cd/7.6.0/amd64/iso-cd/debian-7.6.0-amd64-CD-1.iso'
> import requests
> r = requests.get(url).read(0,1000)  ‍
>
> why i can not download special range(from 0 to 10000)  content with requests
> in python‍?

Looking into my crystal ball, I think you're trying to have this send
the Range header. If that's the case, then there's no way you can do
that with the read() method; you have to incorporate that into the
original request, and then just read everything the server sends you.

If that's not what you're talking about, please explain further,
preferably demonstrating what you want to happen at the HTTP level.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: how to download special range content with requests in python? Chris Angelico <rosuav@gmail.com> - 2014-07-24 01:58 +1000

csiph-web