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

Aaron Lewis aaron.lewis1989 at gmail.com
Sun Mar 14 04:51:39 CET 2010


Hi,
    I have a QHttp class , and after it sends data to server , i'd like
to know the Http Response Code
    e.g 200 means page exists , 404 means it doesn't exist.

-snip-
    QHttp req;
    if(method.toLatin1() == "GET")
    {
        req.get(url);
    }else if(method.toLatin1() == "POST"){
        req.post(url,"");
    }  
// int responseNumber  ...       get Http response Code
// switch responseNumber { .. } ..  Check Http response Code

-snip-

Any ideas will appreciate ;-)

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