[Qt-interest] [SOLVED] Re: QHttp howto get response code ? e.g 200 , 404

Aaron Lewis aaron.lewis1989 at gmail.com
Tue Mar 16 14:56:22 CET 2010


Thank you Thiago , i'll try to use QNetworkAccessManager instead of QHttp.

BTW: Should Qt update its example , the http client ?

It's here:    examples/network/http

Thiago Macieira wrote:
> Em Terça-feira 16 Março 2010, às 13:50:51, aaron lewis escreveu:
>   
>> Finally , i found there's an example in Qt (http client)
>> I read that code , and found my problem.
>>
>> I didn't set the port.
>>
>> -snip-
>>     QString method = ui->methodBox->currentText();
>>     QUrl Url = QUrl(url);
>>
>>     http->setHost(ui->webBox->currentText());
>>
>>     QHttp::ConnectionMode mode = QHttp::ConnectionModeHttp;
>>     http->setHost(Url.host(), mode, 80);
>> -snip-
>>   And then set up and connection to receive status code
>>
>> Thanks All ;-)
>>     
>
> Please use QNetworkAccessManager for any new code. Don't use QHttp.
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>   


-- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode




More information about the Qt-interest-old mailing list