[Qt-interest] [SOLVED] Re: Howto get http status code ?

Aaron Lewis aaron.lewis1989 at gmail.com
Wed Mar 17 13:30:55 CET 2010


Thanks Zhengtao , Http status code is called `attribute' in 
QNetworkRequest , i'll notice that.

Zhengtao Zhang wrote:
> Check this out
>
>
> void yourclass::parseReal404(QNetworkReply *reply){
>   
>     QVariant statusCodeV = 
> reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
>
> Then check the attribute of QNetworkReply for detail
>
> Good luck!
>
> Zhengtao Zhang
>
>
>
>
> On 17 March 2010 12:56, Aaron Lewis <aaron.lewis1989 at gmail.com 
> <mailto:aaron.lewis1989 at gmail.com>> wrote:
>
>     Hi,
>
>     I tried to work with QNetworkAccessManager , everything's fine now.
>
>     Can anyone tell me how to read http status code ?
>
>     I tried QNetworkReply's Help , didn't found something useful.
>
>     -snip-
>     connect(manager, SIGNAL(finished(QNetworkReply*)),
>                this, SLOT(parseReal404(QNetworkReply*)));
>
>
>     void sample::signalHandler(QNetworkReply *reply)
>
>     -snip-
>
>     I signalHandler to handle QNetworkReply when signal is emitted from
>     QNetworkAccessManager,
>     So now i should add sth. in sample::signalHandler , to parse http
>     status
>     code.
>
>     Thanks all.
>
>     --
>     Best Regards,
>     Aaron Lewis - PGP: 0x4A6D32A0
>     FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
>     irc: A4r0n on freenode
>
>     _______________________________________________
>     Qt-interest mailing list
>     Qt-interest at trolltech.com <mailto:Qt-interest at trolltech.com>
>     http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
>
>
> -- 
> Kind regards / Met vriendelijke groet,
>
> Zhengtao Zhang
>
> Oliver Hardystraat 4
> 1235 CS Almere
> 0031 642716096


-- 
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