I’ve thought about implementing an Android application that will download data from a third-party website. The website contains multiple pages, each one containing only about 200 bytes of useful data and around 20 Kbytes of data that I don’t want to use. Is there any way to download only that part of a document? Or somehow filter the data to minimize the amount of downloaded information? Thanks in advance.
I’ve thought about implementing an Android application that will download data from a third-party
Share
You need the
RangeHTTP request header, with which you can specify a start and end inclusive byte address within the resource.will retrieve the first 100 bytes, as the header specifies the region from the first byte (at offset zero) up to and including the 100th byte (at offset 99). Likewise
will retrieve the first byte.
Get it working first with the BBC web site, that I know honours the
Rangeheader.This returns the first fourteen bytes of the page
<!DOCTYPE html.Then plug in our own site. If it still gives you the whole site then you’re out of lukc and you can’t restict what’s returned I’m afraid.
It wouldn’t be fair to leave you with just a Perl version. Here’s the Java
which outputs
showing that just 14 bytes have been read. Plug your URL into this and see if it behaves.