PDA

View Full Version : Why do I have to set the host in a QHttp object?



dhjdhj
16th July 2009, 14:57
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,

jpn
16th July 2009, 15:05
I wondered the same. But now there is more powerful QNAM...

dhjdhj
16th July 2009, 15:12
What is QNAM .... ?

nish
16th July 2009, 15:18
QNetworkAcessManager i suppose

jpn
16th July 2009, 15:29
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.

dhjdhj
16th July 2009, 19:26
Hmmm, I was just following the tutorials.

hashb
28th October 2009, 14:17
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 :)