Results 1 to 7 of 7

Thread: Why do I have to set the host in a QHttp object?

  1. #1
    Join Date
    Jul 2009
    Posts
    41
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Why do I have to set the host in a QHttp object?

    I'm just curious about motivation --- my team is committing to Qt and so we're making some simple examples to get a feel for the environment.

    I was trying the QHttp object with the "get" method which, according to the docs, can accept a complete URL (which includes the host).

    Yet I found that it wouldn't work unless I explicitly used QHttp::setHost first. Why can't the "get" method extract the host from the URL, when it's there?

    Curiously,

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Why do I have to set the host in a QHttp object?

    I wondered the same. But now there is more powerful QNAM...
    J-P Nurmi

  3. #3
    Join Date
    Jul 2009
    Posts
    41
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Why do I have to set the host in a QHttp object?

    What is QNAM .... ?

  4. #4
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Why do I have to set the host in a QHttp object?

    QNetworkAcessManager i suppose

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Why do I have to set the host in a QHttp object?

    From QHttp docs:
    However, for new applications, it is recommended to use QNetworkAccessManager and QNetworkReply, as those classes possess a simpler, yet more powerful API.
    J-P Nurmi

  6. #6
    Join Date
    Jul 2009
    Posts
    41
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Why do I have to set the host in a QHttp object?

    Hmmm, I was just following the tutorials.

  7. #7
    Join Date
    Jun 2009
    Posts
    74
    Thanks
    23
    Thanked 2 Times in 2 Posts

    Smile Re: Why do I have to set the host in a QHttp object?

    Great news for me
    Because I'm suffering of how to use http to connect a website which need user&passwd ,such as Qt Center.
    I think I should try QNetworkAccessManager now

Similar Threads

  1. Replies: 4
    Last Post: 19th February 2009, 11:10
  2. Help with Q_PROPERTY with object pointer
    By lni in forum Qt Programming
    Replies: 1
    Last Post: 16th January 2009, 17:31
  3. Replies: 0
    Last Post: 9th September 2008, 12:57
  4. From QHttp to QHttp over SSL
    By Nyphel in forum Newbie
    Replies: 1
    Last Post: 3rd July 2007, 10:41
  5. QHttp : Host vs IP adress
    By Nyphel in forum Newbie
    Replies: 5
    Last Post: 15th April 2007, 11:21

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.