http status code in khtml

David Faure faure at kde.org
Wed Jan 25 18:05:35 GMT 2006


On Tuesday 24 January 2006 19:40, Miroslav Suchý wrote:
> Miroslav Suchý wrote:
> > Hello all.
> > When I open web page in KHTMLPart class, where I can find http status
> > code of this page (like 200 OK, 404 not found)? I can not find in
> > documentation.
> > 
> > Regards
> > 	Miroslav Suchy
> 
> I read all documentation of KHTMLPart, but I did not find any
> information about http status code. I try to read *.cpp code and trace
> method last_modified(), which should take its information from HTTP
> headers, because I can take http status code from headers too. But trace
> of last_modified() end in class QFileInfo, which is not connected with
> HTTP headers :(
> So I change and specify my question:
> I have class derived from KHTMLPart and I need access to HTTP headers of
> opened page. Can somebody point me where I can find it?
> 
> I was also looking in KIO::*, but it is huge and I was totaly lost in
> documentation.

job->addMetaData("PropagateHttpHeader","true") should give you the HTTP headers
at the end of the job. When using KHTMLPart, you can connect to started(KIO::Job*) in order
to get the job instance being used to download the stuff.
Connect to the result signal, and in the slot there, use job->metaData("HTTP-Headers").

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).





More information about the kfm-devel mailing list