[Qt-interest] [SOLVED] Re: QHttp howto get response code ? e.g 200 , 404
aaron lewis
aaron.lewis1989 at gmail.com
Tue Mar 16 13:50:51 CET 2010
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 ;-)
2010/3/15 Aaron Lewis <aaron.lewis1989 at gmail.com>
> Ok , i'll try with this new class.
>
> Markus Goetz wrote:
> > ext Aaron Lewis wrote:
> >> Hi,
> >> I have a QHttp class , and after it sends data to server , i'd like
> >> to know the Http Response Code
> >>
> > Please use QNetworkAccessManager. QHttp is deprecated.
> >
> > QNetworkReply then as an .attribute() for this
> >
> http://doc.trolltech.com/main-snapshot/qnetworkrequest.html#Attribute-enum
> >
> >
> > Markus
>
>
> --
> Best Regards,
> Aaron Lewis - PGP: 0x4A6D32A0
> FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
> irc: A4r0n on freenode
>
>
--
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100316/e5414d15/attachment.html
More information about the Qt-interest-old
mailing list