Results 1 to 2 of 2

Thread: The "Range" option in QHttpRequestHeader does not work?

  1. #1
    Join Date
    Mar 2010
    Posts
    92
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default The "Range" option in QHttpRequestHeader does not work?

    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:

    Qt Code:
    1. httpRequestAborted = false;
    2. QHttpRequestHeader header = http->currentRequest();
    3. header.setValue("Range", "bytes=0-1024");
    4. httpGetId = http->get(url.path(), file);
    To copy to clipboard, switch view to plain text mode 

    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
    Last edited by wysota; 19th April 2010 at 09:39. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: The "Range" option in QHttpRequestHeader does not work?

    You are modifying a local copy of the header object.

Similar Threads

  1. Replies: 1
    Last Post: 5th January 2010, 13:34
  2. Replies: 0
    Last Post: 15th November 2009, 09:40
  3. setWritingSystem gives "out of range" error
    By jano_alex_es in forum Newbie
    Replies: 0
    Last Post: 2nd October 2009, 11:33
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  5. Replies: 6
    Last Post: 3rd November 2006, 11:53

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.