PDA

View Full Version : The "Range" option in QHttpRequestHeader does not work?



nhs_0702
19th April 2010, 10:33
Hi dear all,

I'm reading the code of QT attached http sample(examples\network\http).

In HttpWindow::downloadFile(), I added a key&value pair to the
QHttpRequestHeader, like this:


httpRequestAborted = false;
QHttpRequestHeader header = http->currentRequest();
header.setValue("Range", "bytes=0-1024");
httpGetId = http->get(url.path(), file);

It should only return the beginning 1024 bytes, but it returned all of the
document(over 700k). I'm rather confused about this.
It seems that the "Range" does not work.

Please give me some light on this, thanks

wysota
19th April 2010, 10:36
You are modifying a local copy of the header object.