QtWebKit QWebPage::acceptNavigationRequest and POST data

557 Views Asked by At

is it possible to access POST data at this (QWebPage::acceptNavigationRequest) moment? I wish to peek at request's POST data there because I locked navigation and I don't have the opportunity at NetworkAccessManager::createRequest because that it not reached.

Thanks!

2

There are 2 best solutions below

0
On

Are you the one creating the request? If you're making the request, you should be able to see the POST data. If it's a webpage that you didn't create making the request, you should use another tool like Wireshark to look at the data sent to the server.

0
On

yes it is possible simply overwrite the QNetworkAccessManager::createRequest Member to:

QNetworkReply * networkaccessman::createRequest ( Operation op, const QNetworkRequest & req, QIODevice * outgoingData )
{if(outgoingData){
        qDebug()<<"%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%";
    qDebug()<<outgoingData->peek(1000000);
}
    return QNetworkAccessManager::createRequest (  op, req, outgoingData  );
}