KIO: how to get the header fields

Koos Vriezen koos.vriezen at xs4all.nl
Fri May 2 15:38:59 BST 2003


On Fri, 2 May 2003, Dawit A. wrote:

> On Friday 02 May 2003 08:29, Koos Vriezen wrote:
>
> > What I would like is the response code 404 and the header fields (I'am
> > able to get both the mimetype and metadata field). How do I do that with
> > kio?
>
> Tell kio_http to send you the header information. It doesn't do that by
> default:
>
> job->addMetaData("PropagateHttpHeader", "true");
>
> To retrieve the returned header, simply query for "HTTP-Headers" meta-data in
> the slot that is connected to receive the incoming data:
>
> QString headers = job->queryMetaData("HTTP-Headers");
>
> Each header line is separated by "\n" so you can use QStringList::split to get
> the individual lines...

Nice, thanks! Btw, should this info be somewhere in kio/job*.h?

> Regards,
> Dawit A.
>





More information about the kfm-devel mailing list