Results 1 to 19 of 19

Thread: using Qhttp with www(x) sites

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2006
    Posts
    17
    Thanks
    2
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Question using Qhttp with www(x) sites

    my current project involves using the qhttp class or qt-3.4 to connect to various sites, which worked fine until it encountered a request for a site like 'www3.someurl.com'

    It kicked back an error message that it couldn't find the host.

    how do you connect to www(x) sites ?

    Thanks in advance

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: using Qhttp with www(x) sites

    Name of the server shouldn't have any impact on QHttp. Could you provide any example of non working URL?

  3. #3
    Join Date
    Mar 2006
    Posts
    17
    Thanks
    2
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: using Qhttp with www(x) sites

    www63.hattrick.org

    just don't spam or DNS them !

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: using Qhttp with www(x) sites

    Does your application handle redirects?

    code: 302, reason: Object moved
    <head><title>Object moved</title></head>
    <body><h1>Object Moved</h1>This object may be found <a HREF="/Common/default.asp">here</a>.</body>

  5. #5
    Join Date
    Mar 2006
    Posts
    17
    Thanks
    2
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: using Qhttp with www(x) sites

    Quote Originally Posted by jacek
    Does your application handle redirects?
    Hmmm, not sure. I check the header and see if I'm reciveing a redirect, though I'd assum that a host not found would mean I'm not getting so much as a header, but I will see...

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

    Default Re: using Qhttp with www(x) sites

    Can you connect to that particular server using a web browser?

  7. #7
    Join Date
    Mar 2006
    Posts
    17
    Thanks
    2
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: using Qhttp with www(x) sites

    yes, I can.

  8. #8
    Join Date
    Mar 2006
    Posts
    17
    Thanks
    2
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: using Qhttp with www(x) sites

    hmmm...

    maybe I am having problems because of syncing qhttp.

    The download procedure requires a series of downloads, so
    I was using this statement:

    while(http.state() != QHttp::Unconnected){;}

    so that my program flow could be one function, instead declaring a slot function for each download in the series. But that while loop isn't working. Any suggestions ?

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: using Qhttp with www(x) sites

    QHttp needs a running event loop.

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

    Default Re: using Qhttp with www(x) sites

    In short words, use signals and slots. For Hattrick I use the requestFinished slot and store a type of request along the request id. This way I know if I'm in a search-server, login, logout or download phase and can easily redirect to the appropriate method which handles the next phase.

  11. The following user says thank you to wysota for this useful post:

    importantman (31st March 2006)

  12. #11
    Join Date
    Mar 2006
    Posts
    17
    Thanks
    2
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: using Qhttp with www(x) sites

    > For Hattrick I use the requestFinished slot and store a type of request along the request id.

    that's a good idea, better than changing signal/slot connections !!

    (surprised someone here knows hattrick)

    btw: how do you enter quotes in this thing ?

    and jacek: what is a running event loop ?

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

    Default Re: using Qhttp with www(x) sites

    Quote Originally Posted by importantman
    www63.hattrick.org

    just don't spam or DNS them !
    Don't worry, I used QHttp to connecto to HT successfully. Some hattrick servers become unresponsive from time to time.

Similar Threads

  1. From QHttp to QHttp over SSL
    By Nyphel in forum Newbie
    Replies: 1
    Last Post: 3rd July 2007, 10:41

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
  •  
Qt is a trademark of The Qt Company.