[Qt-interest] Access to HTTP Status Code with QNetworkReply

Geffrey Velasquez geffrix at hotmail.com
Thu Apr 22 09:20:20 CEST 2010


Hi all,

I would like to know if its possible to access the HTTP Status code from a QNetworkReply object. I mean the codes defined by HTTP:

       Status-Code    = "200"   ; OK
                      | "201"   ; Created
                      | "202"   ; Accepted
                      | "204"   ; No Content
                      | "301"   ; Moved Permanently
                      | "302"   ; Moved Temporarily
                      | "304"   ; Not Modified
                      | "400"   ; Bad Request
                      | "401"   ; Unauthorized
                      | "403"   ; Forbidden
                      | "404"   ; Not Found
                      | "500"   ; Internal Server Error
                      | "501"   ; Not Implemented
                      | "502"   ; Bad Gateway
                      | "503"   ; Service Unavailable
                      | extension-code

       extension-code = 3DIGIT

I was trying with :

    QList<QByteArray> listHeaders;

    listHeaders = reply->rawHeaderList();

    QByteArray header;

    foreach(header, listHeaders) {
        printf("%s: %s\n", header.data(), reply->rawHeader(header).data());
    }


But the status code is not returned as Header. 


Regards,

Geffrey


 		 	   		  
_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100422/9a8490ba/attachment.html 


More information about the Qt-interest-old mailing list