简体   繁体   中英

Qt, catch form values in QNetworkRequest

I have a QWebView component in my Qt widget application. And I have already created a network manager to handle requests from the QWebView .

What I want to do is catching the values of the web form inside QWebView , up to this point of time I have the QNetworkRequest instance of every network request.

How to extract the form values from the QNetworkRequest instance ?

You can use this function of QNetworkRequest class:

QByteArray QNetworkRequest::rawHeader ( const QByteArray & headerName ) const

which returns the raw form of header named headerName .

Are you talking about the values on the get method?

    int i= 0;
    QPair<QString , QString > values;
    while( i < ui->webView->url().queryItems().count() )
    {
        values =  ui->webView->url().queryItems().at( i );
        i++;
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM