Skip to content

Instantly share code, notes, and snippets.

@aishraj
Created May 26, 2012 02:17
Show Gist options
  • Select an option

  • Save aishraj/2791744 to your computer and use it in GitHub Desktop.

Select an option

Save aishraj/2791744 to your computer and use it in GitHub Desktop.
The changed version of the file
#include "showHttp.h"
#include <kdebug.h>
showHttp::showHttp()
{
output();
}
showHttp::~showHttp()
{}
void showHttp::output()
{
kDebug() << "entering function";
// creating a kioslave
//KIO::TransferJob *job = KIO::get(KUrl("http://download.services.openoffice.org/files/stable/3.3.0/OOo-SDK_3.3.0_Linux_x86-64_install-deb_en-US.tar.gz"));
KIO::TransferJob *job = KIO::get(KUrl("http://www.kde.org"));
job->addMetaData("PropagateHttpHeader","true");
job->setRedirectionHandlingEnabled(false);
connect (job, SIGNAL( data(KIO::Job *, const QByteArray & )), this, SLOT(headerIsHere(KIO::Job *)));
// connect(job, SIGNAL(result(KJob*)), this, SLOT(headerIsHere(KIO::Job*)));
//connect(job,SIGNAL(result(KJob*))
}
void showHttp::headerIsHere(KIO::Job* metaJob)
{
QString httpHeaders = metaJob->queryMetaData("HTTP-Headers");
qDebug() << "data is here";
qDebug()<< httpHeaders;
exit(0);
}
#include "showHttp.moc"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment