QNetworkAccessManager and Xml reply

edmanja40

New Member
I was trying to send a request using QNetworkAccessmanager to localhost/conductor/api/provider_accounts.xml but the problem is when I open it with my browser then I get the appropriate output but when I do the same with QNetworkAccessmanager then I am not getting anything at all. Here is my code \[code\] void ServiceProvider::replyFinished(QNetworkReply * reply) { qDebug()<<reply->readAll(); QString data=http://stackoverflow.com/questions/11022822/(QString)reply->readAll(); qDebug()<<data; QXmlStreamReader xml(data); QXmlStreamAttributes attrib; while(!xml.atEnd()){ xml.readNextStartElement(); if(xml.name()=="name" && !xml.isEndElement()){ attrib=xml.attributes(); QString name=attrib.value("name").toString(); qDebug()<<name; } }}void ServiceProvider::pushImage(){manager = new QNetworkAccessManager(this);manager->get(QNetworkRequest(QUrl("https://localhost/conductor /api/provider_accounts.xml")));connect(manager, SIGNAL(finished(QNetworkReply*)),this, SLOT(replyFinished(QNetworkReply*)));}\[/code\]
 
Back
Top